你需要 moment.lang (警告:自 moment 以来已弃用 ,请改用):lang()
2.8.0
locale()
moment.lang("de").format('LLL');
http://momentjs.com/docs/#/i18n/
从 v2.8.1 开始,设置本地化,但不返回 .一些例子:moment.locale('de')
moment
var march = moment('2017-03')
console.log(march.format('MMMM')) // 'March'
moment.locale('de') // returns the new locale, in this case 'de'
console.log(march.format('MMMM')) // 'March' still, since the instance was before the locale was set
var deMarch = moment('2017-03')
console.log(deMarch.format('MMMM')) // 'März'
// You can, however, change just the locale of a specific moment
march.locale('es')
console.log(march.format('MMMM')) // 'Marzo'
总而言之,调用全局设置所有未来实例的区域设置,但不返回 的实例。调用实例,为该实例设置该实例并返回该实例。locale
moment
moment
moment
locale
此外,正如Shiv在评论中所说,请确保使用“moment-with-locales.min.js”而不是“moment.min.js”,否则它将不起作用。