0
在默認語言(en)正常工作。在不同的langualge中獲取月份名稱數組
moment().format('LL'); \\ 25 December 2014
moment.months(); \\ ["January", "February","March","April","May","June","July","August","September","October","November","December"]
用不同的語言
現在 - (PT-BR)
var pt = moment().locale('pt-br');
pt.format('LL'); \\ 25 de dezembro de 2014
pt.months(); \\ 11
pt.months();
- 爲什麼不返回月份名稱的數組?
有沒有不同的方法來獲取月份數組?
您的語言環境是否首先定義月份名稱? (如http://momentjs.com/docs/#/customization/month-names/中所述) – CBroe
我已經加入了「moment-with-locales.min.js」。那麼我是否需要定義月份名稱? – Napster