Merge "Don't fallback from uk to ru"
[lhc/web/wiklou.git] / resources / lib / moment / locale / zh-cn.js
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
5
6 (function (factory) {
7 // Comment out broken wrapper, see T145382
8 /*if (typeof define === 'function' && define.amd) {
9 define(['moment'], factory); // AMD
10 } else if (typeof exports === 'object') {
11 module.exports = factory(require('../moment')); // Node
12 } else {
13 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
14 }*/
15 factory(this.moment);
16 }(function (moment) {
17 return moment.defineLocale('zh-cn', {
18 months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
19 monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
20 weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
21 weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),
22 weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
23 longDateFormat : {
24 LT : 'Ah点mm',
25 LTS : 'Ah点m分s秒',
26 L : 'YYYY-MM-DD',
27 LL : 'YYYY年MMMD日',
28 LLL : 'YYYY年MMMD日LT',
29 LLLL : 'YYYY年MMMD日ddddLT',
30 l : 'YYYY-MM-DD',
31 ll : 'YYYY年MMMD日',
32 lll : 'YYYY年MMMD日LT',
33 llll : 'YYYY年MMMD日ddddLT'
34 },
35 meridiem : function (hour, minute, isLower) {
36 var hm = hour * 100 + minute;
37 if (hm < 600) {
38 return '凌晨';
39 } else if (hm < 900) {
40 return '早上';
41 } else if (hm < 1130) {
42 return '上午';
43 } else if (hm < 1230) {
44 return '中午';
45 } else if (hm < 1800) {
46 return '下午';
47 } else {
48 return '晚上';
49 }
50 },
51 calendar : {
52 sameDay : function () {
53 return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';
54 },
55 nextDay : function () {
56 return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';
57 },
58 lastDay : function () {
59 return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';
60 },
61 nextWeek : function () {
62 var startOfWeek, prefix;
63 startOfWeek = moment().startOf('week');
64 prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';
65 return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
66 },
67 lastWeek : function () {
68 var startOfWeek, prefix;
69 startOfWeek = moment().startOf('week');
70 prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]';
71 return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
72 },
73 sameElse : 'LL'
74 },
75 ordinalParse: /\d{1,2}(日|月|周)/,
76 ordinal : function (number, period) {
77 switch (period) {
78 case 'd':
79 case 'D':
80 case 'DDD':
81 return number + '日';
82 case 'M':
83 return number + '月';
84 case 'w':
85 case 'W':
86 return number + '周';
87 default:
88 return number;
89 }
90 },
91 relativeTime : {
92 future : '%s内',
93 past : '%s前',
94 s : '几秒',
95 m : '1分钟',
96 mm : '%d分钟',
97 h : '1小时',
98 hh : '%d小时',
99 d : '1天',
100 dd : '%d天',
101 M : '1个月',
102 MM : '%d个月',
103 y : '1年',
104 yy : '%d年'
105 },
106 week : {
107 // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
108 dow : 1, // Monday is the first day of the week.
109 doy : 4 // The week that contains Jan 4th is the first week of the year.
110 }
111 });
112 }));