Moment.js, a JavaScript date library for parsing, validating, manipulating, and formatting dates, packaged for Meteor.
For Meteor v0.9.0 and above:
meteor add mrt:moment
For Meteor versions below v0.9.0 using Meteorite/AtmosphereJS:
mrt add moment
Just like the moment docs tell you:
var oneMomentPlease = moment();
To send all moment locales to the client, set the following environment variables:
METEOR_MOMENT_OPTS='{"clientLocales":"ALL"}'
- Locales are currently not supported on the server. This is due to the locales explicitly asking for the "window" object.
- In the future, I'd like to load only select locales. However, for now, it must remain a dream. Or a future pull request from one of you lovely people. That would be nice.
- There seems to be some kind of caching of packaged files going on. If you toggle loading of locale files and restaart the server, there are times when the locales will load when not requested, and vice versa.