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.

130 lines
4.2 KiB

//! moment.js locale configuration
//! locale : Bengali (Bangladesh) [bn-bd]
//! author : Asraf Hossain Patoary : https://github.com/ashwoolford
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('bn-bd', {
months: 'জি_ফি_মচ_এপিল_ম_জন_জই_আগসট_সবর_অকবর_নভবর_ডিবর'.split(
'_'
),
monthsShort:
'জ_ফ_মচ_এপিল_ম_জন_জই_আগসট_সট_অক_নভ_ডি'.split(
'_'
),
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;
} else if (meridiem === 'দর') {
return hour >= 3 ? hour : hour + 12;
} else if (meridiem === 'বিল') {
return hour + 12;
} else if (meridiem === 'সন') {
return hour + 12;
}
},
meridiem: function (hour, minute, isLower) {
if (hour < 4) {
return 'রত';
} else if (hour < 6) {
return 'ভর';
} else if (hour < 12) {
return 'সকল';
} else if (hour < 15) {
return 'দর';
} else if (hour < 18) {
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.
},
});