1 // moment.js locale configuration
2 // locale : chinese (zh-cn)
3 // author : suupic : https://github.com/suupic
4 // author : Zeno Zeng : https://github.com/zenozeng
7 if (typeof define
=== 'function' && define
.amd
) {
8 define(['moment'], factory
); // AMD
9 } else if (typeof exports
=== 'object') {
10 module
.exports
= factory(require('../moment')); // Node
12 factory((typeof global
!== 'undefined' ? global
: this).moment
); // node or other global
15 return moment
.defineLocale('zh-cn', {
16 months
: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
17 monthsShort
: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
18 weekdays
: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
19 weekdaysShort
: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
20 weekdaysMin
: '日_一_二_三_四_五_六'.split('_'),
27 LLLL
: 'YYYY年MMMD日ddddLT',
31 llll
: 'YYYY年MMMD日ddddLT'
33 meridiem : function (hour
, minute
, isLower
) {
34 var hm
= hour
* 100 + minute
;
37 } else if (hm
< 900) {
39 } else if (hm
< 1130) {
41 } else if (hm
< 1230) {
43 } else if (hm
< 1800) {
50 sameDay : function () {
51 return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';
53 nextDay : function () {
54 return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';
56 lastDay : function () {
57 return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';
59 nextWeek : function () {
60 var startOfWeek
, prefix
;
61 startOfWeek
= moment().startOf('week');
62 prefix
= this.unix() - startOfWeek
.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';
63 return this.minutes() === 0 ? prefix
+ 'dddAh点整' : prefix
+ 'dddAh点mm';
65 lastWeek : function () {
66 var startOfWeek
, prefix
;
67 startOfWeek
= moment().startOf('week');
68 prefix
= this.unix() < startOfWeek
.unix() ? '[上]' : '[本]';
69 return this.minutes() === 0 ? prefix
+ 'dddAh点整' : prefix
+ 'dddAh点mm';
73 ordinalParse
: /\d{1,2}(日|月|周)/,
74 ordinal : function (number
, period
) {
105 // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
106 dow
: 1, // Monday is the first day of the week.
107 doy
: 4 // The week that contains Jan 4th is the first week of the year.