gom-latn.js 4.1 KB

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