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 locale/humanize #16
Comments
Not exactly sure what you mean. Native moment durations have the If you're using this plugin, you can provide whatever template string you want, in whatever language. The default template function is not exactly i18n friendly (but you could provide your own). Are you looking for the already-existing duration |
Thanks for your reply. Basically, this is my problem: moment/moment#348 I need a precise version of |
OK, got it. I'll take a look at everything. I'm not sure where this fits. |
Took a look at this today and I have a bunch of questions. In the current version of my plugin, you could supply a localized format template, and you could customize the format tokens to match what users might expect in their language, e.g. The only thing you can't change is the decimal point separator I could auto-detect the decimal point separator based on the environment using Number.prototype.toLocaleString (see http://stackoverflow.com/questions/1074660/with-a-browser-how-do-i-know-which-decimal-separator-does-the-client-use) and allow override via a new That would be pretty simple and I think it makes sense. Do you also want a new addition to the format grammar to be able to write format template strings that automatically reference the moment locale relativeTime strings? Something along the lines of this:
...except that I just noticed that for locale Also, it seems like you might sometimes want the output from I'm having trouble coming up with a version of this feature that is simpler/easier/better than either supplying your own localized format template string to my plugin or using the What do you think? |
I've added the decimalSeparator option, so you can now localize the format grammar, the default format template function, and the decimal separator used in the output. You can provide your own localized template as well. Closing this for now because I can't figure out how to use the moment.js localization strings for duration formatting in this plugin in a way that makes sense. |
Sorry for bumping but any news on this issue (and also moment/moment#348 that have a lot of +1) ? BTW: HumanizeDuration package works pretty well to humanize duration (with local), but it would be nice to have this feature in moment. |
Could this plugin support
humanize()
?It would be awesome if we could use momentjs i18n support: http://momentjs.com/docs/#/i18n/
Or is it up to us to provide a template that uses i18n?
The text was updated successfully, but these errors were encountered: