Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timestamp fields fail when creating or updating a doc #71

Closed
Spencer-Easton opened this issue Jan 31, 2020 · 4 comments · Fixed by #72
Closed

timestamp fields fail when creating or updating a doc #71

Spencer-Easton opened this issue Jan 31, 2020 · 4 comments · Fixed by #72
Labels

Comments

@Spencer-Easton
Copy link
Contributor

The following code will fail with error:

Cannot convert firestore.v1.Value with type unset.

  db.updateDocument('Timestamps/LastUpdated', {
      lastUpdated: new Date()
    } , true);

Currently timestamps are wrapped by:

function wrapDate_ (date) {
        return {'timestampValue': date}
    }

I propose the simple addition of toISOString:

function wrapDate_ (date) {
        return {'timestampValue': date.toISOString()}
    }
@Xendrez
Copy link

Xendrez commented Mar 7, 2020

Any chance for getting this in soon?

@Doomd
Copy link

Doomd commented Mar 30, 2020

@Xendrez I had to fork the library and change this line myself. Then I just used my library instead...kind of a pain, but if you're desperate for it to work, it should only take about 10 minutes to set up.

@Spencer-Easton
Copy link
Contributor Author

I also use a fork in my build. Not sure if anyone is actually maintaining this repo.

@LaughDonor
Copy link
Collaborator

So I finally got around to trying this out myself, and I don't seem to have any issues with the original or the updated code. Not sure if it's because I'm in the same time zone as the Firestore DB. But it checks out.

@LaughDonor LaughDonor added the bug label May 1, 2020
@LaughDonor LaughDonor linked a pull request May 1, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants