grahamearley / FirestoreGoogleAppsScript

A Google Apps Script library for accessing Google Cloud Firestore.
http://grahamearley.website/blog/2017/10/18/firestore-in-google-apps-script.html
MIT License
648 stars 109 forks source link

Problems when updating Dates #75

Closed gmrperdigao closed 4 years ago

gmrperdigao commented 4 years ago

Hi! I'm using a cell value containing a date to update a document's field. It was working properly on Friday, but today the same function is updating this date as an empty map and not as a timestamp. Does someone knows what could have happened?

Doomd commented 4 years ago

Please provide your code...

AndresPrez commented 4 years ago

Im experiencing the same issue. My date fields are inserted as empty Maps.

LaughDonor commented 4 years ago

@AndresPrez , could you please provide some of your code so that I can reproduce your issue?

AndresPrez commented 4 years ago

Sure, give me a moment. But basically Im getting the "Date" Object from a google spreadsheet Date cell. My Date object looks like this: image

Then when parsed by this library's _wrapDate function, the timestampValue looks like this:

image

AndresPrez commented 4 years ago

Hey @LaughDonor, I just copied all your files (from release b35c224, v24) into my Google Appscript project and it worked.

My guess is that this release code might not be properly updated in Google's Libraries repo?

Thanks for this amazing library though.

LaughDonor commented 4 years ago

Right, this was fixed in 0edb5f705c3d6e4e127829c43aa94778a01e2ee6 which is scheduled for the next release.

shoumik1 commented 4 years ago

@LaughDonor I seem to be having the same issue when submitting a Date. The resulting field in the document is an empty map even when using v26.

shoumik1 commented 4 years ago

Apologies, the issue was due to using the V8 runtime. The Legacy runtime works perfectly! If anyone else runs into this go to Run -> Disable new Apps Script runtime powered by Chrome V8.