-
Notifications
You must be signed in to change notification settings - Fork 55
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
DateTimeOffset is transfered as UTC DateTime (losing information about offset) #108
Comments
Btw, this seems not to hard to fix, so I'll try to send PR (at least I'll get more into your great library :) ) |
Hello there Roman, This might be a bug I am not sure, if I don't have a special case specified, it means I am just letting JSON stuff happen at two places, on the server using FableJsonConverter and on the client using SimpleJson so you have to consider how things are deserialized as well. In the case of Because we have full control over the process you can change the representation of what gets sent from the server and match the result on the client, for example you can send Let me know if you have any questions! |
Ok, need to change my words - it won't be so easy to fix (however the libs seems to be written really in a clean way and great for external contribution! 👏 ) I did some investigation and sending To be honest, now I am quite confused where to dig next. Thanks for any hint. |
Almost! you should be looking into the In Fable 2, I am using Json.stringify from the SimpleJson which uses the default serialization function If serialization of This is similar to the BigInt issue from latest Fable Can you please open an issue in Fable with details (expected vs, actual)? Maybe there is a way to use reflection to control how everything is serialized instead of relying of |
Oh, my fault! So it is in Client2. Sorry for misunderstanding and thanks for all the patience. Yes, the JSON.stringify seems to be a big fun - I found another related question on SO (https://stackoverflow.com/questions/31096130/how-to-json-stringify-a-javascript-date-and-preserve-timezone) I'll create an issue in Fable repo. Thanks Zaid! |
Roman I think I was able to hack my way around If the problem persists, please re-open the issue |
You are magician, Zaid! It works! 👍 Thanks a lot again! 🙏 |
Awesome! glad it worked 😄 |
Hi Zaid,
I found interesting thing. When sending DateTimeOffset to server from Fable app, what is actually sent to server is DateTime in UTC format, which leads to loosing information about client offset. I checked the Converter (https://github.com/Zaid-Ajaj/Fable.Remoting/blob/master/Fable.Remoting.Json/FableConverter.fs#L27-L39) and there is no
DateTimeOffset
case.Is it bug or is it on purpose?
The text was updated successfully, but these errors were encountered: