// moment.js language configuration
// language : chinese
// author : suupic : https://github.com/suupic
+// author : Zeno Zeng : https://github.com/zenozeng
(function (factory) {
if (typeof define === 'function' && define.amd) {
llll : "YYYY年MMMD日ddddLT"
},
meridiem : function (hour, minute, isLower) {
- if (hour < 6) {
+ var hm = hour*100 + minute;
+ if (hm < 600) {
return "凌晨";
- } else if (hour < 9) {
+ } else if (hm < 900) {
return "早上";
- } else if (hour < 11 && minute < 30) {
+ } else if (hm < 1130) {
return "上午";
- } else if (hour < 13 && minute < 30) {
+ } else if (hm < 1230) {
return "中午";
- } else if (hour < 18) {
+ } else if (hm < 1800) {
return "下午";
} else {
return "晚上";
}
},
calendar : {
- sameDay : function() {
+ sameDay : function () {
return this.minutes() === 0 ? "[今天]Ah[点整]" : "[今天]T";
},
- nextDay : function() {
+ nextDay : function () {
return this.minutes() === 0 ? "[明天]Ah[点整]" : "[明天]T";
},
- lastDay : function() {
+ lastDay : function () {
return this.minutes() === 0 ? "[昨天]Ah[点整]" : "[昨天]T";
},
- nextWeek : function() {
+ nextWeek : function () {
var startOfWeek, prefix;
startOfWeek = moment().startOf('week');
- prefix = this.unix() - startOfWeek.unix() > 7*24*3600 ? '[下]' : '[本]';
- return this.minutes() === 0 ? prefix+"dddAh点整" : prefix+"dddAh点mm";
+ prefix = this.unix() - startOfWeek.unix() > 7 * 24 * 3600 ? '[下]' : '[本]';
+ return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm";
},
- lastWeek : function() {
+ lastWeek : function () {
var startOfWeek, prefix;
startOfWeek = moment().startOf('week');
prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]';
- return this.minutes() === 0 ? prefix+"dddAh点整" : prefix+"dddAh点mm";
+ return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm";
},
sameElse : 'L'
},
ordinal : function (number, period) {
switch (period) {
- case "d" :
- case "D" :
- case "DDD" :
+ case "d":
+ case "D":
+ case "DDD":
return number + "日";
- case "M" :
+ case "M":
return number + "月";
- case "w" :
- case "W" :
+ case "w":
+ case "W":
return number + "周";
- default :
+ default:
return number;
}
},