Skip to content
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

Support internationalised formatting #84

Open
Looveh opened this issue Jan 31, 2017 · 7 comments
Open

Support internationalised formatting #84

Looveh opened this issue Jan 31, 2017 · 7 comments

Comments

@Looveh
Copy link

Looveh commented Jan 31, 2017

It would be very useful to get support for formatting dates in other languages than English, considering the amount of internationalised ClojureScript out there.

Google's closure library already has mature support for this so it might be a good idea to wrap the goog.i18n module for human readable formatting: https://google.github.io/closure-library/api/goog.i18n.html

@monstasat
Copy link

+1
Also highly interested in unparsing datetime objects into strings with months and weekdays names in other languages than English.
Do you have plans to implement this?

@andrewmcveigh
Copy link
Owner

I'd love for cljs-time to have i18n support, but as a typical anglophone I don't have any personal need for it. So unfortunately it's not that high on my priority list.

Would accept a PR ;)

@andrewmcveigh
Copy link
Owner

andrewmcveigh commented Feb 15, 2017

Having thought about it, I'd like to do something about this. I'm working on a branch #85

I'm not 100% sure on the API, but I think it would work as follows.

By default, cljs-time would use the locale symbols set in goog.i18n.DateTimeSymbols, but you could override this with the following code.

(cljs-time.format/with-locale (cljs-time.format/formatter "EEEE dd MMMM yyyy") "pt_BR")

Does that sound reasonable?

Thanks to @CarlosSam for contributing #77

@monstasat
Copy link

@andrewmcveigh , that sounds great! I think this is reasonable as it mimics clj-time (joda-time) API. Thank you for implementing this!

@monstasat
Copy link

@andrewmcveigh , when do you plan to merge branch with i18n support into master and release a new version of cljs-time?

@gphilipp
Copy link

gphilipp commented Jun 6, 2017

@andrewmcveigh I'm very interested in this as well.

@Grahack
Copy link

Grahack commented Sep 24, 2017

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants