Firestore DateTime field loading as nanoseconds and seconds


#1

On another note:
When I reload data from firestorm service my date time firestorm field gets imported into your React Studio Sheet filed as nanoseconds and seconds – not as date time
See screen shots

Also there is no atomic element for date time field? what element do you suggest I use to handle date time field as seen in Firestore – see format attached

Steve
Firestore data

53

ReactStudio data sheet after reload

52

I have found the code fix in firebase.google.com
19

If you can implement downloading code ( – toDate() --) to view and then saving back to nano and seconds firestore format when saving field. (-- fromDate(date) returns firebase.firestore.Timestamp --)

many thanks Steve


#2

Hi,

Unfortunately we don’t have “Datetime” column type in Data sheets so we can’t detect if the column type is “Datetime”. Youn can always tweak the plugin code to reformat the date for certain columns but I’d still suggest to use Unix time and store it into normal Number or String field. If you need “precision time” (you loose the nanoseconds) then you need to parse the Timestamp column value in Value transformer script.

Converting Unix time into readable format in App is really simple e.g. with Value transformer Script e.g. for Text element:

Example code snippet:

var newDate = new Date(input);
var dateString = newDate.toUTCString();
return dateString

Screen shots of an example app


#3

Thanks Worked

I am using the filename.seconds data sheet value as parsed in available list

16

Because I’m using seconds (Firestorm Timestamp.seconds) I had to * input by 1000
to get milliseconds - as per your commented out Example line.

without * 1000 the result is

13

and with * 1000 the result is

58

Thanks for speedy reply
Steve

my code