// moment.js locale configuration
// locale : Bengali (bn)
// author : Kaushik Gandhi : https://github.com/kaushikgandhi
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
}
}(function (moment) {
var symbolMap = {
'1': 'ā§§',
'2': 'ā§¨',
'3': 'ā§Š',
'4': 'ā§Ē',
'5': 'ā§Ģ',
'6': 'ā§Ŧ',
'7': 'ā§',
'8': 'ā§Ž',
'9': 'ā§¯',
'0': 'ā§Ļ'
},
numberMap = {
'ā§§': '1',
'ā§¨': '2',
'ā§Š': '3',
'ā§Ē': '4',
'ā§Ģ': '5',
'ā§Ŧ': '6',
'ā§': '7',
'ā§Ž': '8',
'ā§¯': '9',
'ā§Ļ': '0'
};
return 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, LT',
LLLL : 'dddd, D MMMM YYYY, LT'
},
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.
}
});
}));