2016-02-06 04:42:48 +08:00
|
|
|
|
//! moment.js locale configuration
|
|
|
|
|
//! locale : Persian (fa)
|
|
|
|
|
//! author : Ebrahim Byagowi : https://github.com/ebraminio
|
|
|
|
|
|
|
|
|
|
;(function (global, factory) {
|
|
|
|
|
typeof exports === 'object' && typeof module !== 'undefined'
|
|
|
|
|
&& typeof require === 'function' ? factory(require('../moment')) :
|
|
|
|
|
typeof define === 'function' && define.amd ? define(['moment'], factory) :
|
|
|
|
|
factory(global.moment)
|
|
|
|
|
}(this, function (moment) { 'use strict';
|
|
|
|
|
|
2014-08-21 02:41:50 +08:00
|
|
|
|
|
|
|
|
|
var symbolMap = {
|
|
|
|
|
'1': '۱',
|
|
|
|
|
'2': '۲',
|
|
|
|
|
'3': '۳',
|
|
|
|
|
'4': '۴',
|
|
|
|
|
'5': '۵',
|
|
|
|
|
'6': '۶',
|
|
|
|
|
'7': '۷',
|
|
|
|
|
'8': '۸',
|
|
|
|
|
'9': '۹',
|
|
|
|
|
'0': '۰'
|
|
|
|
|
}, numberMap = {
|
|
|
|
|
'۱': '1',
|
|
|
|
|
'۲': '2',
|
|
|
|
|
'۳': '3',
|
|
|
|
|
'۴': '4',
|
|
|
|
|
'۵': '5',
|
|
|
|
|
'۶': '6',
|
|
|
|
|
'۷': '7',
|
|
|
|
|
'۸': '8',
|
|
|
|
|
'۹': '9',
|
|
|
|
|
'۰': '0'
|
|
|
|
|
};
|
|
|
|
|
|
2016-02-06 04:42:48 +08:00
|
|
|
|
var fa = moment.defineLocale('fa', {
|
2014-08-21 02:41:50 +08:00
|
|
|
|
months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
|
|
|
|
|
monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'),
|
|
|
|
|
weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
|
|
|
|
|
weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'),
|
|
|
|
|
weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'),
|
2016-05-19 02:58:33 +08:00
|
|
|
|
weekdaysParseExact : true,
|
2014-08-21 02:41:50 +08:00
|
|
|
|
longDateFormat : {
|
|
|
|
|
LT : 'HH:mm',
|
2016-02-06 04:42:48 +08:00
|
|
|
|
LTS : 'HH:mm:ss',
|
2014-08-21 02:41:50 +08:00
|
|
|
|
L : 'DD/MM/YYYY',
|
|
|
|
|
LL : 'D MMMM YYYY',
|
2016-02-06 04:42:48 +08:00
|
|
|
|
LLL : 'D MMMM YYYY HH:mm',
|
|
|
|
|
LLLL : 'dddd, D MMMM YYYY HH:mm'
|
|
|
|
|
},
|
|
|
|
|
meridiemParse: /قبل از ظهر|بعد از ظهر/,
|
|
|
|
|
isPM: function (input) {
|
|
|
|
|
return /بعد از ظهر/.test(input);
|
2014-08-21 02:41:50 +08:00
|
|
|
|
},
|
|
|
|
|
meridiem : function (hour, minute, isLower) {
|
|
|
|
|
if (hour < 12) {
|
2016-02-06 04:42:48 +08:00
|
|
|
|
return 'قبل از ظهر';
|
2014-08-21 02:41:50 +08:00
|
|
|
|
} else {
|
2016-02-06 04:42:48 +08:00
|
|
|
|
return 'بعد از ظهر';
|
2014-08-21 02:41:50 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
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];
|
|
|
|
|
}).replace(/،/g, ',');
|
|
|
|
|
},
|
|
|
|
|
postformat: function (string) {
|
|
|
|
|
return string.replace(/\d/g, function (match) {
|
|
|
|
|
return symbolMap[match];
|
|
|
|
|
}).replace(/,/g, '،');
|
|
|
|
|
},
|
2016-02-06 04:42:48 +08:00
|
|
|
|
ordinalParse: /\d{1,2}م/,
|
2014-08-21 02:41:50 +08:00
|
|
|
|
ordinal : '%dم',
|
|
|
|
|
week : {
|
|
|
|
|
dow : 6, // Saturday is the first day of the week.
|
|
|
|
|
doy : 12 // The week that contains Jan 1st is the first week of the year.
|
|
|
|
|
}
|
|
|
|
|
});
|
2016-02-06 04:42:48 +08:00
|
|
|
|
|
|
|
|
|
return fa;
|
|
|
|
|
|
|
|
|
|
}));
|