Skip to content

Render the timestamp #25

Open
Open
@MincePie

Description

@MincePie

The helper in the article is:

/* helpers */
this.fieldValue = app.firestore.FieldValue;

(note - uppercase FieldValue)

Then in messages, you use:

          createdAt: this.props.firebase.fieldValue.serverTimestamp(),

This gives:

FirebaseError: Function DocumentReference.set() called with invalid data. Unsupported field value: undefined (found in field createdAt)

I have tried uppercasing as:

          createdAt: this.props.firebase.FieldValue.serverTimestamp(),

This gives:

TypeError: Cannot read property 'serverTimestamp' of undefined

In each case, the timestamp does not work.

How do I do I record and display a date?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions