react-firestore-authentication icon indicating copy to clipboard operation
react-firestore-authentication copied to clipboard

Render the timestamp

Open MincePie opened this issue 5 years ago • 1 comments

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?

MincePie avatar Dec 11 '19 02:12 MincePie

A solution that works was finally found and is recorded here. I don't understand it but am EXHAUSTED from focusing on this problem.

https://stackoverflow.com/questions/59277859/react-display-a-firestore-timestamp

I hope this helps someone else

MincePie avatar Jan 10 '20 00:01 MincePie