-
Notifications
You must be signed in to change notification settings - Fork 200
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
Temporal.DateTime parity with Android SDK #1175
Comments
oh I definitely need that too |
Hey folks, any updates on this issue? I can see that it got marked as an "enhancement", while to me it feels more like a bug or some unexpected behaviour: It works as expected on Android. |
Hey @palpatim, sorry, is there any update on the issue or at least a confirmation that it is not on the roadmap (in which case my team would commit to supporting a private fork for the time being)? |
I need this also. Backend is already defined as AWSDateTime. Current work around is to modify the schema.graphql after an |
Really need it even do not take Android behaviour into account. |
@lawmicha sorry, are there any updates to the issue? I've tested with the recent 1.x and 2.x SDKs but the problem persists for more than a year now. |
@lawmicha Any good news on this one please? 🙏 |
Apologies for the delayed response. Our team will look into the issue and provide an update. |
@harsh62 Any update on this? |
@diogoepsy , I've made a fix on branch |
Thank you @5d I've tried your branch and every variation that I could of creating a
But the Perhaps there is some Initializer I'm not using properly on this PR? I've made a fork and added the funcionality in there as well if you wanna look into it :) https://github.com/diogoepsy/amplify-ios/commit/a7f1efc86d5b09cf0b6c1d3af43b6be7b28c5ef7 |
Hi @diogoepsy,
Did you tried initialize the Can you double check you are on the correct branch? |
Hey Di Wu, you are absolutely right :) It is working properly and I am able to save the date using the iso8601String representation. Thank you very much! |
This fix was released in 2.25.1. Thanks all for reporting this and for your patience! |
|
As per AWS docs,
While I am aware of #1048, seems like there is a different issue regarding feature parity with Android SDK: while
amplify-ios
supports parsing1970-01-01+05:30
into a validTemporal.DateTime
object, it doesn't support formattingFoundation.Date
orTemporal.DateTime
into an ISO 8601 string with a time zone offset.This causes a mismatch between different platforms if one wants to store dates in DynamoDB offset by users' local timezones.
To Reproduce
Steps to reproduce the behavior:
Temporal.DateTime
object from a String with a shifted timezone:dateTime
object is represented in DynamoDB as2021-04-21T11:44:18.505Z
Expected behavior
Given a local timezone, I'd expected to have a way to specify the formatting option, so
dateTime
ends up in DynamoDB as2021-04-21T11:44:18.505-05:00
instead.Additional context
I am happy to make a PR addressing the issue if that's something on the roadmap anyway / my solution fits into the existing architecture.
Currently
TemporalSpec
forces the encoder to rely oniso8601String
:which is defined with a hardcoded time zone:
If instead an approach akin to Android SDK's
format()
was used:It'd give enough flexibility to specify what should be used for formatting.
The text was updated successfully, but these errors were encountered: