汪总电商平台
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.
 
 
 
 
 
 

203 lines
6.4 KiB

//! moment.js locale configuration
//! locale : Marathi [mr]
//! author : Harshad Kale : https://github.com/kalehv
//! author : Vivek Athalye : https://github.com/vnathalye
import moment from '../moment';
var symbolMap = {
1: '१',
2: '२',
3: '३',
4: '४',
5: '५',
6: '६',
7: '७',
8: '८',
9: '९',
0: '०',
},
numberMap = {
'१': '1',
'२': '2',
'३': '3',
'४': '4',
'५': '5',
'६': '6',
'७': '7',
'८': '8',
'९': '9',
'०': '0',
};
function relativeTimeMr(number, withoutSuffix, string, isFuture) {
var output = '';
if (withoutSuffix) {
switch (string) {
case 's':
output = 'कद';
break;
case 'ss':
output = '%d सद';
break;
case 'm':
output = 'एक मििट';
break;
case 'mm':
output = '%d मिि';
break;
case 'h':
output = 'एक तस';
break;
case 'hh':
output = '%d तस';
break;
case 'd':
output = 'एक दिवस';
break;
case 'dd':
output = '%d दिवस';
break;
case 'M':
output = 'एक महि';
break;
case 'MM':
output = '%d महि';
break;
case 'y':
output = 'एक वरष';
break;
case 'yy':
output = '%d वर';
break;
}
} else {
switch (string) {
case 's':
output = 'क';
break;
case 'ss':
output = '%d स';
break;
case 'm':
output = 'एकिि';
break;
case 'mm':
output = '%d मिि';
break;
case 'h':
output = 'एक';
break;
case 'hh':
output = '%d त';
break;
case 'd':
output = 'एकिवस';
break;
case 'dd':
output = '%d दिवस';
break;
case 'M':
output = 'एक महि';
break;
case 'MM':
output = '%d महि';
break;
case 'y':
output = 'एक वर';
break;
case 'yy':
output = '%d वर';
break;
}
}
return output.replace(/%d/i, number);
}
export default moment.defineLocale('mr', {
months: 'ज_फ_मच_एपिल_म_जन_ज_ऑगसट_सपबर_ऑकबर_नबर_डिबर'.split(
'_'
),
monthsShort:
'ज._फ._मच._एपि._म._जन._ज._ऑग._सप._ऑक._न._डि.'.split(
'_'
),
monthsParseExact: true,
weekdays: 'रविर_समवर_मगळवर_बधवर_गर_शरवर_शनिर'.split('_'),
weekdaysShort: 'रवि_सम_मगळ_बध_ग_शर_शनि'.split('_'),
weekdaysMin: 'र_स_म_ब_ग_श_श'.split('_'),
longDateFormat: {
LT: 'A h:mm वजत',
LTS: 'A h:mm:ss वजत',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY, A h:mm वजत',
LLLL: 'dddd, D MMMM YYYY, A h:mm वजत',
},
calendar: {
sameDay: '[आज] LT',
nextDay: '[उद] LT',
nextWeek: 'dddd, LT',
lastDay: '[कल] LT',
lastWeek: '[मल] dddd, LT',
sameElse: 'L',
},
relativeTime: {
future: '%sमध',
past: '%sप',
s: relativeTimeMr,
ss: relativeTimeMr,
m: relativeTimeMr,
mm: relativeTimeMr,
h: relativeTimeMr,
hh: relativeTimeMr,
d: relativeTimeMr,
dd: relativeTimeMr,
M: relativeTimeMr,
MM: relativeTimeMr,
y: relativeTimeMr,
yy: relativeTimeMr,
},
preparse: function (string) {
return string.replace(/[१२३४५६७८९०]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /पह|सक|द|स|र/,
meridiemHour: function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'पह' || meridiem === 'सक') {
return hour;
} else if (
meridiem === 'द' ||
meridiem === 'स' ||
meridiem === 'र'
) {
return hour >= 12 ? hour : hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour >= 0 && hour < 6) {
return 'पह';
} else if (hour < 12) {
return 'सक';
} else if (hour < 17) {
return 'द';
} else if (hour < 20) {
return 'स';
} else {
return 'र';
}
},
week: {
dow: 0, // Sunday is the first day of the week.
doy: 6, // The week that contains Jan 6th is the first week of the year.
},
});