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.

112 lines
4.2 KiB

3 weeks ago
//! moment.js locale configuration
//! locale : Bengali (bn)
//! author : Kaushik Gandhi : https://github.com/kaushikgandhi
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['moment'], factory) :
factory(global.moment)
}(this, function (moment) { 'use strict';
var symbolMap = {
'1': '১',
'2': '২',
'3': '৩',
'4': '৪',
'5': '৫',
'6': '৬',
'7': '৭',
'8': '৮',
'9': '৯',
'0': '০'
},
numberMap = {
'১': '1',
'২': '2',
'৩': '3',
'৪': '4',
'৫': '5',
'৬': '6',
'৭': '7',
'৮': '8',
'৯': '9',
'০': '0'
};
var bn = moment.defineLocale('bn', {
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 : ' ',
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: /|||ি|/,
isPM: function (input) {
return /^(|ি|)$/.test(input);
},
//Bengali is a vast language its spoken
//in different forms in various parts of the world.
//I have just generalized with most common one used
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 1st is the first week of the year.
}
});
return bn;
}));