-
Notifications
You must be signed in to change notification settings - Fork 28
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
Any way to change locale at the moment? #2
Comments
Will look into it! 👍 |
Hi @ctrinh98, I've implemented that feature - you can now add your own locale or extend the existing english locale if you want to: class ShortLocaleEn extends LocaleEn {
String get seconds => '%is';
String get aMinute => '%im';
String get minutes => '%im';
String get anHour => '%ih';
String get hours => '%ih';
String get aDay => '%id';
String get days => '%id';
} To set the locale for all usages of Moment.setLocaleGlobally(new ShortLocaleEn()); To set the locale only for the current instance of var moment = new Moment.now().locale(new ShortLocaleEn()); Hope, this works for you! :) |
Thank you so much!! I can't express how incredible that was -- thank you for responding and implementing my request so quickly! This is perfect for what I want to do! One question -- if I wanted to stop the IdentifierPosition from displaying, how would I set that? I tried writing the following but I keep getting this as an error.
Again, thank you so much! This is really driving forward my enthusiasm with this Flutter project, hahaha! :) |
Whoops, I may have forgotten to export It's corrected in version 0.1.1 I just published. Also thanks for using and improving this package!! :) |
Works perfectly!! Thank you so much for responding to all my requests so quickly and for making such a useful and great package! You're the best! :) |
In vanilla moment.js you can change the locale to say “3m” instead of “3 minutes”, “8s” instead of “8 seconds”, etc. by manually redefining the locale function in your JavaScript code. Is there a way to do that here or perhaps in the future?
The text was updated successfully, but these errors were encountered: