mr.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. //! moment.js locale configuration
  2. //! locale : Marathi [mr]
  3. //! author : Harshad Kale : https://github.com/kalehv
  4. //! author : Vivek Athalye : https://github.com/vnathalye
  5. ;(function (global, factory) {
  6. typeof exports === 'object' && typeof module !== 'undefined'
  7. && typeof require === 'function' ? factory(require('../moment')) :
  8. typeof define === 'function' && define.amd ? define(['../moment'], factory) :
  9. factory(global.moment)
  10. }(this, (function (moment) { 'use strict';
  11. var symbolMap = {
  12. '1': '१',
  13. '2': '२',
  14. '3': '३',
  15. '4': '४',
  16. '5': '५',
  17. '6': '६',
  18. '7': '७',
  19. '8': '८',
  20. '9': '९',
  21. '0': '०'
  22. };
  23. var numberMap = {
  24. '१': '1',
  25. '२': '2',
  26. '३': '3',
  27. '४': '4',
  28. '५': '5',
  29. '६': '6',
  30. '७': '7',
  31. '८': '8',
  32. '९': '9',
  33. '०': '0'
  34. };
  35. function relativeTimeMr(number, withoutSuffix, string, isFuture)
  36. {
  37. var output = '';
  38. if (withoutSuffix) {
  39. switch (string) {
  40. case 's': output = 'काही सेकंद'; break;
  41. case 'ss': output = '%d सेकंद'; break;
  42. case 'm': output = 'एक मिनिट'; break;
  43. case 'mm': output = '%d मिनिटे'; break;
  44. case 'h': output = 'एक तास'; break;
  45. case 'hh': output = '%d तास'; break;
  46. case 'd': output = 'एक दिवस'; break;
  47. case 'dd': output = '%d दिवस'; break;
  48. case 'M': output = 'एक महिना'; break;
  49. case 'MM': output = '%d महिने'; break;
  50. case 'y': output = 'एक वर्ष'; break;
  51. case 'yy': output = '%d वर्षे'; break;
  52. }
  53. }
  54. else {
  55. switch (string) {
  56. case 's': output = 'काही सेकंदां'; break;
  57. case 'ss': output = '%d सेकंदां'; break;
  58. case 'm': output = 'एका मिनिटा'; break;
  59. case 'mm': output = '%d मिनिटां'; break;
  60. case 'h': output = 'एका तासा'; break;
  61. case 'hh': output = '%d तासां'; break;
  62. case 'd': output = 'एका दिवसा'; break;
  63. case 'dd': output = '%d दिवसां'; break;
  64. case 'M': output = 'एका महिन्या'; break;
  65. case 'MM': output = '%d महिन्यां'; break;
  66. case 'y': output = 'एका वर्षा'; break;
  67. case 'yy': output = '%d वर्षां'; break;
  68. }
  69. }
  70. return output.replace(/%d/i, number);
  71. }
  72. var mr = moment.defineLocale('mr', {
  73. months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'),
  74. monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'),
  75. monthsParseExact : true,
  76. weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  77. weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
  78. weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
  79. longDateFormat : {
  80. LT : 'A h:mm वाजता',
  81. LTS : 'A h:mm:ss वाजता',
  82. L : 'DD/MM/YYYY',
  83. LL : 'D MMMM YYYY',
  84. LLL : 'D MMMM YYYY, A h:mm वाजता',
  85. LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता'
  86. },
  87. calendar : {
  88. sameDay : '[आज] LT',
  89. nextDay : '[उद्या] LT',
  90. nextWeek : 'dddd, LT',
  91. lastDay : '[काल] LT',
  92. lastWeek: '[मागील] dddd, LT',
  93. sameElse : 'L'
  94. },
  95. relativeTime : {
  96. future: '%sमध्ये',
  97. past: '%sपूर्वी',
  98. s: relativeTimeMr,
  99. ss: relativeTimeMr,
  100. m: relativeTimeMr,
  101. mm: relativeTimeMr,
  102. h: relativeTimeMr,
  103. hh: relativeTimeMr,
  104. d: relativeTimeMr,
  105. dd: relativeTimeMr,
  106. M: relativeTimeMr,
  107. MM: relativeTimeMr,
  108. y: relativeTimeMr,
  109. yy: relativeTimeMr
  110. },
  111. preparse: function (string) {
  112. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  113. return numberMap[match];
  114. });
  115. },
  116. postformat: function (string) {
  117. return string.replace(/\d/g, function (match) {
  118. return symbolMap[match];
  119. });
  120. },
  121. meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/,
  122. meridiemHour : function (hour, meridiem) {
  123. if (hour === 12) {
  124. hour = 0;
  125. }
  126. if (meridiem === 'रात्री') {
  127. return hour < 4 ? hour : hour + 12;
  128. } else if (meridiem === 'सकाळी') {
  129. return hour;
  130. } else if (meridiem === 'दुपारी') {
  131. return hour >= 10 ? hour : hour + 12;
  132. } else if (meridiem === 'सायंकाळी') {
  133. return hour + 12;
  134. }
  135. },
  136. meridiem: function (hour, minute, isLower) {
  137. if (hour < 4) {
  138. return 'रात्री';
  139. } else if (hour < 10) {
  140. return 'सकाळी';
  141. } else if (hour < 17) {
  142. return 'दुपारी';
  143. } else if (hour < 20) {
  144. return 'सायंकाळी';
  145. } else {
  146. return 'रात्री';
  147. }
  148. },
  149. week : {
  150. dow : 0, // Sunday is the first day of the week.
  151. doy : 6 // The week that contains Jan 1st is the first week of the year.
  152. }
  153. });
  154. return mr;
  155. })));