Add Moment.js library for working with date and time
[lhc/web/wiklou.git] / resources / moment / lang / zh-cn.js
1 // moment.js language configuration
2 // language : chinese
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(window.moment); // Browser global
13 }
14 }(function (moment) {
15 return moment.lang('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 L : "YYYY年MMMD日",
24 LL : "YYYY年MMMD日",
25 LLL : "YYYY年MMMD日LT",
26 LLLL : "YYYY年MMMD日ddddLT",
27 l : "YYYY年MMMD日",
28 ll : "YYYY年MMMD日",
29 lll : "YYYY年MMMD日LT",
30 llll : "YYYY年MMMD日ddddLT"
31 },
32 meridiem : function (hour, minute, isLower) {
33 var hm = hour * 100 + minute;
34 if (hm < 600) {
35 return "凌晨";
36 } else if (hm < 900) {
37 return "早上";
38 } else if (hm < 1130) {
39 return "上午";
40 } else if (hm < 1230) {
41 return "中午";
42 } else if (hm < 1800) {
43 return "下午";
44 } else {
45 return "晚上";
46 }
47 },
48 calendar : {
49 sameDay : function () {
50 return this.minutes() === 0 ? "[今天]Ah[点整]" : "[今天]LT";
51 },
52 nextDay : function () {
53 return this.minutes() === 0 ? "[明天]Ah[点整]" : "[明天]LT";
54 },
55 lastDay : function () {
56 return this.minutes() === 0 ? "[昨天]Ah[点整]" : "[昨天]LT";
57 },
58 nextWeek : function () {
59 var startOfWeek, prefix;
60 startOfWeek = moment().startOf('week');
61 prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';
62 return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm";
63 },
64 lastWeek : function () {
65 var startOfWeek, prefix;
66 startOfWeek = moment().startOf('week');
67 prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]';
68 return this.minutes() === 0 ? prefix + "dddAh点整" : prefix + "dddAh点mm";
69 },
70 sameElse : 'L'
71 },
72 ordinal : function (number, period) {
73 switch (period) {
74 case "d":
75 case "D":
76 case "DDD":
77 return number + "日";
78 case "M":
79 return number + "月";
80 case "w":
81 case "W":
82 return number + "周";
83 default:
84 return number;
85 }
86 },
87 relativeTime : {
88 future : "%s内",
89 past : "%s前",
90 s : "几秒",
91 m : "1分钟",
92 mm : "%d分钟",
93 h : "1小时",
94 hh : "%d小时",
95 d : "1天",
96 dd : "%d天",
97 M : "1个月",
98 MM : "%d个月",
99 y : "1年",
100 yy : "%d年"
101 },
102 week : {
103 // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
104 dow : 1, // Monday is the first day of the week.
105 doy : 4 // The week that contains Jan 4th is the first week of the year.
106 }
107 });
108 }));