Merge "Don't localize parentheses in version number in parserTests.php"
[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 if (typeof define === 'function' && define.amd) {
8 define(['moment'], factory); // AMD
9 } else if (typeof exports === 'object') {
10 module.exports = factory(require('../moment')); // Node
11 } else {
12 factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
13 }
14 }(function (moment) {
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('_'),
21 longDateFormat : {
22 LT : 'Ah点mm',
23 LTS : 'Ah点m分s秒',
24 L : 'YYYY-MM-DD',
25 LL : 'YYYY年MMMD日',
26 LLL : 'YYYY年MMMD日LT',
27 LLLL : 'YYYY年MMMD日ddddLT',
28 l : 'YYYY-MM-DD',
29 ll : 'YYYY年MMMD日',
30 lll : 'YYYY年MMMD日LT',
31 llll : 'YYYY年MMMD日ddddLT'
32 },
33 meridiem : function (hour, minute, isLower) {
34 var hm = hour * 100 + minute;
35 if (hm < 600) {
36 return '凌晨';
37 } else if (hm < 900) {
38 return '早上';
39 } else if (hm < 1130) {
40 return '上午';
41 } else if (hm < 1230) {
42 return '中午';
43 } else if (hm < 1800) {
44 return '下午';
45 } else {
46 return '晚上';
47 }
48 },
49 calendar : {
50 sameDay : function () {
51 return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT';
52 },
53 nextDay : function () {
54 return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT';
55 },
56 lastDay : function () {
57 return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT';
58 },
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';
64 },
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';
70 },
71 sameElse : 'LL'
72 },
73 ordinalParse: /\d{1,2}(日|月|周)/,
74 ordinal : function (number, period) {
75 switch (period) {
76 case 'd':
77 case 'D':
78 case 'DDD':
79 return number + '日';
80 case 'M':
81 return number + '月';
82 case 'w':
83 case 'W':
84 return number + '周';
85 default:
86 return number;
87 }
88 },
89 relativeTime : {
90 future : '%s内',
91 past : '%s前',
92 s : '几秒',
93 m : '1分钟',
94 mm : '%d分钟',
95 h : '1小时',
96 hh : '%d小时',
97 d : '1天',
98 dd : '%d天',
99 M : '1个月',
100 MM : '%d个月',
101 y : '1年',
102 yy : '%d年'
103 },
104 week : {
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.
108 }
109 });
110 }));