gom-latn.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //! moment.js locale configuration
  2. //! locale : Konkani Latin script [gom-latn]
  3. //! author : The Discoverer : https://github.com/WikiDiscoverer
  4. ;(function (global, factory) {
  5. typeof exports === 'object' && typeof module !== 'undefined'
  6. && typeof require === 'function' ? factory(require('../moment')) :
  7. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  8. factory(global.moment)
  9. }(this, (function (moment) { 'use strict';
  10. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  11. var format = {
  12. 's': ['thodde secondanim', 'thodde second'],
  13. 'm': ['eka mintan', 'ek minute'],
  14. 'mm': [number + ' mintanim', number + ' mintam'],
  15. 'h': ['eka horan', 'ek hor'],
  16. 'hh': [number + ' horanim', number + ' hor'],
  17. 'd': ['eka disan', 'ek dis'],
  18. 'dd': [number + ' disanim', number + ' dis'],
  19. 'M': ['eka mhoinean', 'ek mhoino'],
  20. 'MM': [number + ' mhoineanim', number + ' mhoine'],
  21. 'y': ['eka vorsan', 'ek voros'],
  22. 'yy': [number + ' vorsanim', number + ' vorsam']
  23. };
  24. return withoutSuffix ? format[key][0] : format[key][1];
  25. }
  26. var gomLatn = moment.defineLocale('gom-latn', {
  27. months : 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split('_'),
  28. monthsShort : 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split('_'),
  29. monthsParseExact : true,
  30. weekdays : 'Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son\'var'.split('_'),
  31. weekdaysShort : 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
  32. weekdaysMin : 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
  33. weekdaysParseExact : true,
  34. longDateFormat : {
  35. LT : 'A h:mm [vazta]',
  36. LTS : 'A h:mm:ss [vazta]',
  37. L : 'DD-MM-YYYY',
  38. LL : 'D MMMM YYYY',
  39. LLL : 'D MMMM YYYY A h:mm [vazta]',
  40. LLLL : 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]',
  41. llll: 'ddd, D MMM YYYY, A h:mm [vazta]'
  42. },
  43. calendar : {
  44. sameDay: '[Aiz] LT',
  45. nextDay: '[Faleam] LT',
  46. nextWeek: '[Ieta to] dddd[,] LT',
  47. lastDay: '[Kal] LT',
  48. lastWeek: '[Fatlo] dddd[,] LT',
  49. sameElse: 'L'
  50. },
  51. relativeTime : {
  52. future : '%s',
  53. past : '%s adim',
  54. s : processRelativeTime,
  55. m : processRelativeTime,
  56. mm : processRelativeTime,
  57. h : processRelativeTime,
  58. hh : processRelativeTime,
  59. d : processRelativeTime,
  60. dd : processRelativeTime,
  61. M : processRelativeTime,
  62. MM : processRelativeTime,
  63. y : processRelativeTime,
  64. yy : processRelativeTime
  65. },
  66. dayOfMonthOrdinalParse : /\d{1,2}(er)/,
  67. ordinal : function (number, period) {
  68. switch (period) {
  69. // the ordinal 'er' only applies to day of the month
  70. case 'D':
  71. return number + 'er';
  72. default:
  73. case 'M':
  74. case 'Q':
  75. case 'DDD':
  76. case 'd':
  77. case 'w':
  78. case 'W':
  79. return number;
  80. }
  81. },
  82. week : {
  83. dow : 1, // Monday is the first day of the week.
  84. doy : 4 // The week that contains Jan 4th is the first week of the year.
  85. },
  86. meridiemParse: /rati|sokalli|donparam|sanje/,
  87. meridiemHour : function (hour, meridiem) {
  88. if (hour === 12) {
  89. hour = 0;
  90. }
  91. if (meridiem === 'rati') {
  92. return hour < 4 ? hour : hour + 12;
  93. } else if (meridiem === 'sokalli') {
  94. return hour;
  95. } else if (meridiem === 'donparam') {
  96. return hour > 12 ? hour : hour + 12;
  97. } else if (meridiem === 'sanje') {
  98. return hour + 12;
  99. }
  100. },
  101. meridiem : function (hour, minute, isLower) {
  102. if (hour < 4) {
  103. return 'rati';
  104. } else if (hour < 12) {
  105. return 'sokalli';
  106. } else if (hour < 16) {
  107. return 'donparam';
  108. } else if (hour < 20) {
  109. return 'sanje';
  110. } else {
  111. return 'rati';
  112. }
  113. }
  114. });
  115. return gomLatn;
  116. })));