2014-09-30 12:29:53 +02:00
|
|
|
|
// moment.js locale configuration
|
|
|
|
|
// locale : hindi (hi)
|
2014-07-31 18:00:20 +02:00
|
|
|
|
// author : Mayank Singhal : https://github.com/mayanksinghal
|
|
|
|
|
|
|
|
|
|
(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(window.moment); // Browser 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'
|
|
|
|
|
};
|
|
|
|
|
|
2014-09-30 12:29:53 +02:00
|
|
|
|
return moment.defineLocale('hi', {
|
|
|
|
|
months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
|
|
|
|
|
monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
|
|
|
|
|
weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
|
|
|
|
|
weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
|
|
|
|
|
weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'),
|
2014-07-31 18:00:20 +02:00
|
|
|
|
longDateFormat : {
|
2014-09-30 12:29:53 +02:00
|
|
|
|
LT : 'A h:mm बजे',
|
|
|
|
|
L : 'DD/MM/YYYY',
|
|
|
|
|
LL : 'D MMMM YYYY',
|
|
|
|
|
LLL : 'D MMMM YYYY, LT',
|
|
|
|
|
LLLL : 'dddd, D MMMM YYYY, LT'
|
2014-07-31 18:00:20 +02:00
|
|
|
|
},
|
|
|
|
|
calendar : {
|
|
|
|
|
sameDay : '[आज] LT',
|
|
|
|
|
nextDay : '[कल] LT',
|
|
|
|
|
nextWeek : 'dddd, LT',
|
|
|
|
|
lastDay : '[कल] LT',
|
|
|
|
|
lastWeek : '[पिछले] dddd, LT',
|
|
|
|
|
sameElse : 'L'
|
|
|
|
|
},
|
|
|
|
|
relativeTime : {
|
2014-09-30 12:29:53 +02:00
|
|
|
|
future : '%s में',
|
|
|
|
|
past : '%s पहले',
|
|
|
|
|
s : 'कुछ ही क्षण',
|
|
|
|
|
m : 'एक मिनट',
|
|
|
|
|
mm : '%d मिनट',
|
|
|
|
|
h : 'एक घंटा',
|
|
|
|
|
hh : '%d घंटे',
|
|
|
|
|
d : 'एक दिन',
|
|
|
|
|
dd : '%d दिन',
|
|
|
|
|
M : 'एक महीने',
|
|
|
|
|
MM : '%d महीने',
|
|
|
|
|
y : 'एक वर्ष',
|
|
|
|
|
yy : '%d वर्ष'
|
2014-07-31 18:00:20 +02:00
|
|
|
|
},
|
|
|
|
|
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];
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// Hindi notation for meridiems are quite fuzzy in practice. While there exists
|
|
|
|
|
// a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
|
|
|
|
|
meridiem : function (hour, minute, isLower) {
|
|
|
|
|
if (hour < 4) {
|
2014-09-30 12:29:53 +02:00
|
|
|
|
return 'रात';
|
2014-07-31 18:00:20 +02:00
|
|
|
|
} else if (hour < 10) {
|
2014-09-30 12:29:53 +02:00
|
|
|
|
return 'सुबह';
|
2014-07-31 18:00:20 +02:00
|
|
|
|
} else if (hour < 17) {
|
2014-09-30 12:29:53 +02:00
|
|
|
|
return 'दोपहर';
|
2014-07-31 18:00:20 +02:00
|
|
|
|
} else if (hour < 20) {
|
2014-09-30 12:29:53 +02:00
|
|
|
|
return 'शाम';
|
2014-07-31 18:00:20 +02:00
|
|
|
|
} else {
|
2014-09-30 12:29:53 +02:00
|
|
|
|
return 'रात';
|
2014-07-31 18:00:20 +02:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
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.
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}));
|