-
Notifications
You must be signed in to change notification settings - Fork 91
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
Setup Decoder to decode (FIR)Timestamp to (NS)Date #44
Comments
Would really love a solution for this as well! |
Did anyone fix this problem ? |
Seconding this sentiment. Any progress here? |
Still no fix? |
It'd be great to see such mapping in this library. Exposing Firebase Timestamp type to models is something all developers should stay away of. |
Can we get this fixed? It is now breaking everything |
+1. Updated to the latest Firestore for their new groupCollection query method, but now it gives me this error when I run the app. Swift.DecodingError.typeMismatch(Foundation.Date, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "createdAt", intValue: nil)], debugDescription: "Expected to decode Date but found FIRTimestamp instead.", underlyingError: nil)) |
+1 |
1+ |
Hi guys. I fixed that issue. Here you can find solution: https://github.com/mshershnev/CodableFirebase I did pull request and hope that it will be merged soon: #86 |
Now that Firestore warns us to/ forces the usage of Timestamps over Dates I'm looking for a way to workaround this.
Background: I'm using Models on iOS and watchOS as well. Firebase is not ready for watchOS hence I cannot use
Timestamp
in the models. Besides this I'd prefer to avoid the Firestore dependency in my models. The precision ofDate
is more than enough for me.My models are also contained in a framework that is not aware of Firebase, hence I cannot implement/ override the decoder that parses the Timestamps into Dates.
Question: Is there a way to setup the FirestoreDecoder to automatically parse
Timestamps
toDates
when aDate
is expected in a model?The text was updated successfully, but these errors were encountered: