Using a proto file from an API created in Scala. My code is in JS, trying to test my code and getting the following error:
AssertionError [ERR_ASSERTION]: invalid return value: post[0].lastPublishedDate: Date expected
Tried and didn't work:
lastPublishedDate: {seconds: <date>, nano: <date>}
, with date being a date's toISOString() like mentioned in the docs (https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/timestamp.proto#L115)lastPublishedDate: new Date().toISOString()
- Just putting
2019-02-18T14:18:45.346Z
(that's what the API seems to return when I call it) as the date.
Nothing seems to work for me.
The only other reference to this I could find online is this: https://github.com/dcodeIO/protobuf.js/issues/437 and it also seems unsolved.
Has anyone managed to work with google.protobuf.Timestamp in JS?
setSeconds
andsetNanos
didn't work for me for some reason, but thefromDate
did. Thanks! – Underquote