Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create od-ind.js #6175

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
128 changes: 128 additions & 0 deletions src/od-ind.js
@@ -0,0 +1,128 @@
//! moment.js locale configuration
//! locale : Odia [od-ind]
//! author : Siddhant Singh : https://github.com/SiDD-sIngH


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('od-ind', {
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];

});
},
dayOfMonthOrdinalParse: /\d{1,2}ର୍ଥ/,
ordinal: '%dର୍ଥ',
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 'ରାତି';
}
},
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.
},
});

return or;

})));