2016-02-05 15:42:48 -05:00
|
|
|
|
//! moment.js locale configuration
|
2020-11-10 20:34:26 -05:00
|
|
|
|
//! locale : Persian [fa]
|
|
|
|
|
//! author : Ebrahim Byagowi : https://github.com/ebraminio
|
2016-02-05 15:42:48 -05:00
|
|
|
|
|
|
|
|
|
;(function (global, factory) {
|
|
|
|
|
typeof exports === 'object' && typeof module !== 'undefined'
|
|
|
|
|
&& typeof require === 'function' ? factory(require('../moment')) :
|
2017-04-20 00:24:20 -04:00
|
|
|
|
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
2016-02-05 15:42:48 -05:00
|
|
|
|
factory(global.moment)
|
2017-04-20 00:24:20 -04:00
|
|
|
|
}(this, (function (moment) { 'use strict';
|
2016-02-05 15:42:48 -05:00
|
|
|
|
|
2020-11-10 20:34:26 -05:00
|
|
|
|
//! moment.js locale configuration
|
2014-08-20 14:41:50 -04:00
|
|
|
|
|
2018-04-26 03:15:53 -04:00
|
|
|
|
var symbolMap = {
|
2020-11-10 20:34:26 -05:00
|
|
|
|
1: '۱',
|
|
|
|
|
2: '۲',
|
|
|
|
|
3: '۳',
|
|
|
|
|
4: '۴',
|
|
|
|
|
5: '۵',
|
|
|
|
|
6: '۶',
|
|
|
|
|
7: '۷',
|
|
|
|
|
8: '۸',
|
|
|
|
|
9: '۹',
|
|
|
|
|
0: '۰',
|
|
|
|
|
},
|
|
|
|
|
numberMap = {
|
|
|
|
|
'۱': '1',
|
|
|
|
|
'۲': '2',
|
|
|
|
|
'۳': '3',
|
|
|
|
|
'۴': '4',
|
|
|
|
|
'۵': '5',
|
|
|
|
|
'۶': '6',
|
|
|
|
|
'۷': '7',
|
|
|
|
|
'۸': '8',
|
|
|
|
|
'۹': '9',
|
|
|
|
|
'۰': '0',
|
|
|
|
|
};
|
2014-08-20 14:41:50 -04:00
|
|
|
|
|
2018-04-26 03:15:53 -04:00
|
|
|
|
var fa = moment.defineLocale('fa', {
|
2020-11-10 20:34:26 -05:00
|
|
|
|
months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
|
|
|
|
|
'_'
|
|
|
|
|
),
|
|
|
|
|
monthsShort: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
|
|
|
|
|
'_'
|
|
|
|
|
),
|
|
|
|
|
weekdays: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
|
|
|
|
|
'_'
|
|
|
|
|
),
|
|
|
|
|
weekdaysShort: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
|
|
|
|
|
'_'
|
|
|
|
|
),
|
|
|
|
|
weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),
|
|
|
|
|
weekdaysParseExact: true,
|
|
|
|
|
longDateFormat: {
|
|
|
|
|
LT: 'HH:mm',
|
|
|
|
|
LTS: 'HH:mm:ss',
|
|
|
|
|
L: 'DD/MM/YYYY',
|
|
|
|
|
LL: 'D MMMM YYYY',
|
|
|
|
|
LLL: 'D MMMM YYYY HH:mm',
|
|
|
|
|
LLLL: 'dddd, D MMMM YYYY HH:mm',
|
2018-04-26 03:15:53 -04:00
|
|
|
|
},
|
|
|
|
|
meridiemParse: /قبل از ظهر|بعد از ظهر/,
|
|
|
|
|
isPM: function (input) {
|
|
|
|
|
return /بعد از ظهر/.test(input);
|
|
|
|
|
},
|
2020-11-10 20:34:26 -05:00
|
|
|
|
meridiem: function (hour, minute, isLower) {
|
2018-04-26 03:15:53 -04:00
|
|
|
|
if (hour < 12) {
|
|
|
|
|
return 'قبل از ظهر';
|
|
|
|
|
} else {
|
|
|
|
|
return 'بعد از ظهر';
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-11-10 20:34:26 -05:00
|
|
|
|
calendar: {
|
|
|
|
|
sameDay: '[امروز ساعت] LT',
|
|
|
|
|
nextDay: '[فردا ساعت] LT',
|
|
|
|
|
nextWeek: 'dddd [ساعت] LT',
|
|
|
|
|
lastDay: '[دیروز ساعت] LT',
|
|
|
|
|
lastWeek: 'dddd [پیش] [ساعت] LT',
|
|
|
|
|
sameElse: 'L',
|
2018-04-26 03:15:53 -04:00
|
|
|
|
},
|
2020-11-10 20:34:26 -05:00
|
|
|
|
relativeTime: {
|
|
|
|
|
future: 'در %s',
|
|
|
|
|
past: '%s پیش',
|
|
|
|
|
s: 'چند ثانیه',
|
|
|
|
|
ss: '%d ثانیه',
|
|
|
|
|
m: 'یک دقیقه',
|
|
|
|
|
mm: '%d دقیقه',
|
|
|
|
|
h: 'یک ساعت',
|
|
|
|
|
hh: '%d ساعت',
|
|
|
|
|
d: 'یک روز',
|
|
|
|
|
dd: '%d روز',
|
|
|
|
|
M: 'یک ماه',
|
|
|
|
|
MM: '%d ماه',
|
|
|
|
|
y: 'یک سال',
|
|
|
|
|
yy: '%d سال',
|
2018-04-26 03:15:53 -04:00
|
|
|
|
},
|
|
|
|
|
preparse: function (string) {
|
2020-11-10 20:34:26 -05:00
|
|
|
|
return string
|
|
|
|
|
.replace(/[۰-۹]/g, function (match) {
|
|
|
|
|
return numberMap[match];
|
|
|
|
|
})
|
|
|
|
|
.replace(/،/g, ',');
|
2018-04-26 03:15:53 -04:00
|
|
|
|
},
|
|
|
|
|
postformat: function (string) {
|
2020-11-10 20:34:26 -05:00
|
|
|
|
return string
|
|
|
|
|
.replace(/\d/g, function (match) {
|
|
|
|
|
return symbolMap[match];
|
|
|
|
|
})
|
|
|
|
|
.replace(/,/g, '،');
|
2018-04-26 03:15:53 -04:00
|
|
|
|
},
|
|
|
|
|
dayOfMonthOrdinalParse: /\d{1,2}م/,
|
2020-11-10 20:34:26 -05:00
|
|
|
|
ordinal: '%dم',
|
|
|
|
|
week: {
|
|
|
|
|
dow: 6, // Saturday is the first day of the week.
|
|
|
|
|
doy: 12, // The week that contains Jan 12th is the first week of the year.
|
|
|
|
|
},
|
2018-04-26 03:15:53 -04:00
|
|
|
|
});
|
2016-02-05 15:42:48 -05:00
|
|
|
|
|
2018-04-26 03:15:53 -04:00
|
|
|
|
return fa;
|
2016-02-05 15:42:48 -05:00
|
|
|
|
|
2017-04-20 00:24:20 -04:00
|
|
|
|
})));
|