Node-Red configuration
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.

km.js 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. //! moment.js locale configuration
  2. //! locale : Cambodian [km]
  3. //! author : Kruy Vanna : https://github.com/kruyvanna
  4. import moment from '../moment';
  5. var symbolMap = {
  6. 1: '១',
  7. 2: '២',
  8. 3: '៣',
  9. 4: '៤',
  10. 5: '៥',
  11. 6: '៦',
  12. 7: '៧',
  13. 8: '៨',
  14. 9: '៩',
  15. 0: '០',
  16. },
  17. numberMap = {
  18. '១': '1',
  19. '២': '2',
  20. '៣': '3',
  21. '៤': '4',
  22. '៥': '5',
  23. '៦': '6',
  24. '៧': '7',
  25. '៨': '8',
  26. '៩': '9',
  27. '០': '0',
  28. };
  29. export default moment.defineLocale('km', {
  30. months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
  31. '_'
  32. ),
  33. monthsShort:
  34. 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
  35. '_'
  36. ),
  37. weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  38. weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
  39. weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
  40. weekdaysParseExact: true,
  41. longDateFormat: {
  42. LT: 'HH:mm',
  43. LTS: 'HH:mm:ss',
  44. L: 'DD/MM/YYYY',
  45. LL: 'D MMMM YYYY',
  46. LLL: 'D MMMM YYYY HH:mm',
  47. LLLL: 'dddd, D MMMM YYYY HH:mm',
  48. },
  49. meridiemParse: /ព្រឹក|ល្ងាច/,
  50. isPM: function (input) {
  51. return input === 'ល្ងាច';
  52. },
  53. meridiem: function (hour, minute, isLower) {
  54. if (hour < 12) {
  55. return 'ព្រឹក';
  56. } else {
  57. return 'ល្ងាច';
  58. }
  59. },
  60. calendar: {
  61. sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
  62. nextDay: '[ស្អែក ម៉ោង] LT',
  63. nextWeek: 'dddd [ម៉ោង] LT',
  64. lastDay: '[ម្សិលមិញ ម៉ោង] LT',
  65. lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
  66. sameElse: 'L',
  67. },
  68. relativeTime: {
  69. future: '%sទៀត',
  70. past: '%sមុន',
  71. s: 'ប៉ុន្មានវិនាទី',
  72. ss: '%d វិនាទី',
  73. m: 'មួយនាទី',
  74. mm: '%d នាទី',
  75. h: 'មួយម៉ោង',
  76. hh: '%d ម៉ោង',
  77. d: 'មួយថ្ងៃ',
  78. dd: '%d ថ្ងៃ',
  79. M: 'មួយខែ',
  80. MM: '%d ខែ',
  81. y: 'មួយឆ្នាំ',
  82. yy: '%d ឆ្នាំ',
  83. },
  84. dayOfMonthOrdinalParse: /ទី\d{1,2}/,
  85. ordinal: 'ទី%d',
  86. preparse: function (string) {
  87. return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) {
  88. return numberMap[match];
  89. });
  90. },
  91. postformat: function (string) {
  92. return string.replace(/\d/g, function (match) {
  93. return symbolMap[match];
  94. });
  95. },
  96. week: {
  97. dow: 1, // Monday is the first day of the week.
  98. doy: 4, // The week that contains Jan 4th is the first week of the year.
  99. },
  100. });