//! moment.js locale configuration
//! locale : chinese (zh-cn)
//! author : suupic : https://github.com/suupic
//! author : Zeno Zeng : https://github.com/zenozeng
import moment from '../moment';
export default moment.defineLocale('zh-cn', {
months : '??_??_??_??_??_??_??_??_??_??_???_???'.split('_'),
monthsShort : '1?_2?_3?_4?_5?_6?_7?_8?_9?_10?_11?_12?'.split('_'),
weekdays : '???_???_???_???_???_???_???'.split('_'),
weekdaysShort : '??_??_??_??_??_??_??'.split('_'),
weekdaysMin : '?_?_?_?_?_?_?'.split('_'),
longDateFormat : {
LT : 'Ah?mm?',
LTS : 'Ah?m?s?',
L : 'YYYY-MM-DD',
LL : 'YYYY?MMMD?',
LLL : 'YYYY?MMMD?Ah?mm?',
LLLL : 'YYYY?MMMD?ddddAh?mm?',
l : 'YYYY-MM-DD',
ll : 'YYYY?MMMD?',
lll : 'YYYY?MMMD?Ah?mm?',
llll : 'YYYY?MMMD?ddddAh?mm?'
},
meridiemParse: /??|??|??|??|??|??/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === '??' || meridiem === '??' ||
meridiem === '??') {
return hour;
} else if (meridiem === '??' || meridiem === '??') {
return hour + 12;
} else {
// '??'
return hour >= 11 ? hour : hour + 12;
}
},
meridiem : function (hour, minute, isLower) {
var hm = hour * 100 + minute;
if (hm < 600) {
return '??';
} else if (hm < 900) {
return '??';
} else if (hm < 1130) {
return '??';
} else if (hm < 1230) {
return '??';
} else if (hm < 1800) {
return '??';
} else {
return '??';
}
},
calendar : {
sameDay : function () {
return this.minutes() === 0 ? '[??]Ah[??]' : '[??]LT';
},
nextDay : function () {
return this.minutes() === 0 ? '[??]Ah[??]' : '[??]LT';
},
lastDay : function () {
return this.minutes() === 0 ? '[??]Ah[??]' : '[??]LT';
},
nextWeek : function () {
var startOfWeek, prefix;
startOfWeek = moment().startOf('week');
prefix = this.diff(startOfWeek, 'days') >= 7 ? '[?]' : '[?]';
return this.minutes() === 0 ? prefix + 'dddAh??' : prefix + 'dddAh?mm';
},
lastWeek : function () {
var startOfWeek, prefix;
startOfWeek = moment().startOf('week');
prefix = this.unix() < startOfWeek.unix() ? '[?]' : '[?]';
return this.minutes() === 0 ? prefix + 'dddAh??' : prefix + 'dddAh?mm';
},
sameElse : 'LL'
},
ordinalParse: /\d{1,2}(?|?|?)/,
ordinal : function (number, period) {
switch (period) {
case 'd':
case 'D':
case 'DDD':
return number + '?';
case 'M':
return number + '?';
case 'w':
case 'W':
return number + '?';
default:
return number;
}
},
relativeTime : {
future : '%s?',
past : '%s?',
s : '??',
m : '1 ??',
mm : '%d ??',
h : '1 ??',
hh : '%d ??',
d : '1 ?',
dd : '%d ?',
M : '1 ??',
MM : '%d ??',
y : '1 ?',
yy : '%d ?'
},
week : {
// GB/T 7408-1994?????????·????·??????????ISO 8601:1988??
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
|