zh-hk.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. //! moment.js locale configuration
  2. //! locale : Chinese (Hong Kong) [zh-hk]
  3. //! author : Ben : https://github.com/ben-lin
  4. //! author : Chris Lam : https://github.com/hehachris
  5. //! author : Konstantin : https://github.com/skfd
  6. //! author : Anthony : https://github.com/anthonylau
  7. import moment from '../moment';
  8. export default moment.defineLocale('zh-hk', {
  9. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  10. '_'
  11. ),
  12. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  13. '_'
  14. ),
  15. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  16. weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  17. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  18. longDateFormat: {
  19. LT: 'HH:mm',
  20. LTS: 'HH:mm:ss',
  21. L: 'YYYY/MM/DD',
  22. LL: 'YYYY年M月D日',
  23. LLL: 'YYYY年M月D日 HH:mm',
  24. LLLL: 'YYYY年M月D日dddd HH:mm',
  25. l: 'YYYY/M/D',
  26. ll: 'YYYY年M月D日',
  27. lll: 'YYYY年M月D日 HH:mm',
  28. llll: 'YYYY年M月D日dddd HH:mm',
  29. },
  30. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  31. meridiemHour: function (hour, meridiem) {
  32. if (hour === 12) {
  33. hour = 0;
  34. }
  35. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  36. return hour;
  37. } else if (meridiem === '中午') {
  38. return hour >= 11 ? hour : hour + 12;
  39. } else if (meridiem === '下午' || meridiem === '晚上') {
  40. return hour + 12;
  41. }
  42. },
  43. meridiem: function (hour, minute, isLower) {
  44. var hm = hour * 100 + minute;
  45. if (hm < 600) {
  46. return '凌晨';
  47. } else if (hm < 900) {
  48. return '早上';
  49. } else if (hm < 1200) {
  50. return '上午';
  51. } else if (hm === 1200) {
  52. return '中午';
  53. } else if (hm < 1800) {
  54. return '下午';
  55. } else {
  56. return '晚上';
  57. }
  58. },
  59. calendar: {
  60. sameDay: '[今天]LT',
  61. nextDay: '[明天]LT',
  62. nextWeek: '[下]ddddLT',
  63. lastDay: '[昨天]LT',
  64. lastWeek: '[上]ddddLT',
  65. sameElse: 'L',
  66. },
  67. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  68. ordinal: function (number, period) {
  69. switch (period) {
  70. case 'd':
  71. case 'D':
  72. case 'DDD':
  73. return number + '日';
  74. case 'M':
  75. return number + '月';
  76. case 'w':
  77. case 'W':
  78. return number + '週';
  79. default:
  80. return number;
  81. }
  82. },
  83. relativeTime: {
  84. future: '%s後',
  85. past: '%s前',
  86. s: '幾秒',
  87. ss: '%d 秒',
  88. m: '1 分鐘',
  89. mm: '%d 分鐘',
  90. h: '1 小時',
  91. hh: '%d 小時',
  92. d: '1 天',
  93. dd: '%d 天',
  94. M: '1 個月',
  95. MM: '%d 個月',
  96. y: '1 年',
  97. yy: '%d 年',
  98. },
  99. });