Loading locales in NodeJS1.0.0+
moment.locale(String);
Loading locales in NodeJS is super easy. If there is a locale file in moment-root/locale/
named after that key, the first call to moment.locale
will load it.
var moment = require('moment');
moment.locale('fr');
moment(1316116057189).fromNow(); // il y a une heure
If you want your locale supported, create a pull request to the develop
branch with the required locale and unit test files.
当前内容版权归 momentjs.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 momentjs.com .