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.

125 lines
4.2 KiB

//! moment.js locale configuration
//! locale : Kannada [kn]
//! author : Rajeev Naik : https://github.com/rajeevnaikte
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',
};
export default moment.defineLocale('kn', {
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: 'ಕಲವಷಣಗಳ',
ss: '%d ಸಗಳ',
m: 'ಒಿಿಷ',
mm: '%d ನಿಿಷ',
h: 'ಒ',
hh: '%d ಗ',
d: 'ಒಿನ',
dd: '%d ದಿನ',
M: 'ಒಿಗಳ',
MM: '%d ತಿಗಳ',
y: 'ಒ ವರಷ',
yy: '%d ವರಷ',
},
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 === 'ರಿ') {
return hour < 4 ? hour : hour + 12;
} else if (meridiem === 'ಬಿ') {
return hour;
} else if (meridiem === 'ಮಧನ') {
return hour >= 10 ? hour : hour + 12;
} else if (meridiem === 'ಸ') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'ರಿ';
} else if (hour < 10) {
return 'ಬಿ';
} else if (hour < 17) {
return 'ಮಧನ';
} else if (hour < 20) {
return 'ಸ';
} else {
return 'ರಿ';
}
},
dayOfMonthOrdinalParse: /\d{1,2}(ನ)/,
ordinal: function (number) {
return number + 'ನ';
},
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.
},
});