You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

117 lines
3.9 KiB

  1. //! moment.js locale configuration
  2. //! locale : Chinese (China) [zh-cn]
  3. //! author : suupic : https://github.com/suupic
  4. //! author : Zeno Zeng : https://github.com/zenozeng
  5. ;(function (global, factory) {
  6. typeof exports === 'object' && typeof module !== 'undefined'
  7. && typeof require === 'function' ? factory(require('../moment')) :
  8. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  9. factory(global.moment)
  10. }(this, (function (moment) { 'use strict';
  11. //! moment.js locale configuration
  12. var zhCn = moment.defineLocale('zh-cn', {
  13. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  14. '_'
  15. ),
  16. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  17. '_'
  18. ),
  19. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  20. weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
  21. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  22. longDateFormat: {
  23. LT: 'HH:mm',
  24. LTS: 'HH:mm:ss',
  25. L: 'YYYY/MM/DD',
  26. LL: 'YYYY年M月D日',
  27. LLL: 'YYYY年M月D日Ah点mm分',
  28. LLLL: 'YYYY年M月D日ddddAh点mm分',
  29. l: 'YYYY/M/D',
  30. ll: 'YYYY年M月D日',
  31. lll: 'YYYY年M月D日 HH:mm',
  32. llll: 'YYYY年M月D日dddd HH:mm',
  33. },
  34. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  35. meridiemHour: function (hour, meridiem) {
  36. if (hour === 12) {
  37. hour = 0;
  38. }
  39. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  40. return hour;
  41. } else if (meridiem === '下午' || meridiem === '晚上') {
  42. return hour + 12;
  43. } else {
  44. // '中午'
  45. return hour >= 11 ? hour : hour + 12;
  46. }
  47. },
  48. meridiem: function (hour, minute, isLower) {
  49. var hm = hour * 100 + minute;
  50. if (hm < 600) {
  51. return '凌晨';
  52. } else if (hm < 900) {
  53. return '早上';
  54. } else if (hm < 1130) {
  55. return '上午';
  56. } else if (hm < 1230) {
  57. return '中午';
  58. } else if (hm < 1800) {
  59. return '下午';
  60. } else {
  61. return '晚上';
  62. }
  63. },
  64. calendar: {
  65. sameDay: '[今天]LT',
  66. nextDay: '[明天]LT',
  67. nextWeek: '[下]ddddLT',
  68. lastDay: '[昨天]LT',
  69. lastWeek: '[上]ddddLT',
  70. sameElse: 'L',
  71. },
  72. dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
  73. ordinal: function (number, period) {
  74. switch (period) {
  75. case 'd':
  76. case 'D':
  77. case 'DDD':
  78. return number + '日';
  79. case 'M':
  80. return number + '月';
  81. case 'w':
  82. case 'W':
  83. return number + '周';
  84. default:
  85. return number;
  86. }
  87. },
  88. relativeTime: {
  89. future: '%s后',
  90. past: '%s前',
  91. s: '几秒',
  92. ss: '%d 秒',
  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. return zhCn;
  111. })));