Ohm-Management - Projektarbeit B-ME
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.2KB

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