UNPKG

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