-
Notifications
You must be signed in to change notification settings - Fork 311
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
DateTime Format ToString("MMMM yyyy"); #1593
Comments
Reproduced expected result in FSI. Fable/src/js/fable-core/Util.ts Line 202 in e7954a0
I believe is the function with the incorrect code. here is the full implementation |
https://momentjs.com/ might be a good thing to use here once we get to localization, though we would have to translate from .net's patterns to moment-js patterns. I'm aware we may not fully replicate DateTime.ToString here but a little probably goes a long way.
|
Fable does not support Globalization/Localization in general. For localization support, we added DateFormat in Fable.PowerPack. |
There is also Fable.DateFunctions binding for date-fns that covers most functions and has localization support, although the formatting patterns are a bit different in date-fns
Edit: just ported to Fable 2 stable and it ready to use |
Ah yes thank you for pointing this one too 😊 |
Given that |
@anchann It has already be done: https://github.com/fable-compiler/fable-date The package is called |
@MangelMaxime thank you! |
Is there documentation on how to use Fable.Date anywhere? |
It was a part of Fable.PowerPack so you can find the documentation here however, it seems like the styles is broken. I created an issue fable-compiler/fable-date#2 |
Closing for now, please reopen if necessary. |
Description
Formating DateTime behaves differently on server and client.
Repro code
Repl
Expected and actual results
Expected Result: "October 2018"
Actual Result: "10 2018"
The text was updated successfully, but these errors were encountered: