zh-cn.js 4.0 KB

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