2016-02-06 04:42:48 +08:00
|
|
|
|
//! moment.js locale configuration
|
2020-11-11 09:34:26 +08:00
|
|
|
|
//! locale : Arabic [ar]
|
|
|
|
|
//! author : Abdel Said: https://github.com/abdelsaid
|
|
|
|
|
//! author : Ahmed Elkhatib
|
|
|
|
|
//! author : forabi https://github.com/forabi
|
2016-02-06 04:42:48 +08:00
|
|
|
|
|
|
|
|
|
;(function (global, factory) {
|
|
|
|
|
typeof exports === 'object' && typeof module !== 'undefined'
|
|
|
|
|
&& typeof require === 'function' ? factory(require('../moment')) :
|
2017-04-20 12:24:20 +08:00
|
|
|
|
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
|
2016-02-06 04:42:48 +08:00
|
|
|
|
factory(global.moment)
|
2017-04-20 12:24:20 +08:00
|
|
|
|
}(this, (function (moment) { 'use strict';
|
2016-02-06 04:42:48 +08:00
|
|
|
|
|
2020-11-11 09:34:26 +08:00
|
|
|
|
//! moment.js locale configuration
|
2014-08-21 02:41:50 +08:00
|
|
|
|
|
2018-04-26 15:15:53 +08:00
|
|
|
|
var symbolMap = {
|
2020-11-11 09:34:26 +08:00
|
|
|
|
1: '١',
|
|
|
|
|
2: '٢',
|
|
|
|
|
3: '٣',
|
|
|
|
|
4: '٤',
|
|
|
|
|
5: '٥',
|
|
|
|
|
6: '٦',
|
|
|
|
|
7: '٧',
|
|
|
|
|
8: '٨',
|
|
|
|
|
9: '٩',
|
|
|
|
|
0: '٠',
|
|
|
|
|
},
|
|
|
|
|
numberMap = {
|
|
|
|
|
'١': '1',
|
|
|
|
|
'٢': '2',
|
|
|
|
|
'٣': '3',
|
|
|
|
|
'٤': '4',
|
|
|
|
|
'٥': '5',
|
|
|
|
|
'٦': '6',
|
|
|
|
|
'٧': '7',
|
|
|
|
|
'٨': '8',
|
|
|
|
|
'٩': '9',
|
|
|
|
|
'٠': '0',
|
|
|
|
|
},
|
|
|
|
|
pluralForm = function (n) {
|
|
|
|
|
return n === 0
|
|
|
|
|
? 0
|
|
|
|
|
: n === 1
|
2024-03-11 10:04:51 +08:00
|
|
|
|
? 1
|
|
|
|
|
: n === 2
|
|
|
|
|
? 2
|
|
|
|
|
: n % 100 >= 3 && n % 100 <= 10
|
|
|
|
|
? 3
|
|
|
|
|
: n % 100 >= 11
|
|
|
|
|
? 4
|
|
|
|
|
: 5;
|
2020-11-11 09:34:26 +08:00
|
|
|
|
},
|
|
|
|
|
plurals = {
|
|
|
|
|
s: [
|
|
|
|
|
'أقل من ثانية',
|
|
|
|
|
'ثانية واحدة',
|
|
|
|
|
['ثانيتان', 'ثانيتين'],
|
|
|
|
|
'%d ثوان',
|
|
|
|
|
'%d ثانية',
|
|
|
|
|
'%d ثانية',
|
|
|
|
|
],
|
|
|
|
|
m: [
|
|
|
|
|
'أقل من دقيقة',
|
|
|
|
|
'دقيقة واحدة',
|
|
|
|
|
['دقيقتان', 'دقيقتين'],
|
|
|
|
|
'%d دقائق',
|
|
|
|
|
'%d دقيقة',
|
|
|
|
|
'%d دقيقة',
|
|
|
|
|
],
|
|
|
|
|
h: [
|
|
|
|
|
'أقل من ساعة',
|
|
|
|
|
'ساعة واحدة',
|
|
|
|
|
['ساعتان', 'ساعتين'],
|
|
|
|
|
'%d ساعات',
|
|
|
|
|
'%d ساعة',
|
|
|
|
|
'%d ساعة',
|
|
|
|
|
],
|
|
|
|
|
d: [
|
|
|
|
|
'أقل من يوم',
|
|
|
|
|
'يوم واحد',
|
|
|
|
|
['يومان', 'يومين'],
|
|
|
|
|
'%d أيام',
|
|
|
|
|
'%d يومًا',
|
|
|
|
|
'%d يوم',
|
|
|
|
|
],
|
|
|
|
|
M: [
|
|
|
|
|
'أقل من شهر',
|
|
|
|
|
'شهر واحد',
|
|
|
|
|
['شهران', 'شهرين'],
|
|
|
|
|
'%d أشهر',
|
|
|
|
|
'%d شهرا',
|
|
|
|
|
'%d شهر',
|
|
|
|
|
],
|
|
|
|
|
y: [
|
|
|
|
|
'أقل من عام',
|
|
|
|
|
'عام واحد',
|
|
|
|
|
['عامان', 'عامين'],
|
|
|
|
|
'%d أعوام',
|
|
|
|
|
'%d عامًا',
|
|
|
|
|
'%d عام',
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
pluralize = function (u) {
|
|
|
|
|
return function (number, withoutSuffix, string, isFuture) {
|
|
|
|
|
var f = pluralForm(number),
|
|
|
|
|
str = plurals[u][pluralForm(number)];
|
|
|
|
|
if (f === 2) {
|
|
|
|
|
str = str[withoutSuffix ? 0 : 1];
|
|
|
|
|
}
|
|
|
|
|
return str.replace(/%d/i, number);
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
months = [
|
|
|
|
|
'يناير',
|
|
|
|
|
'فبراير',
|
|
|
|
|
'مارس',
|
|
|
|
|
'أبريل',
|
|
|
|
|
'مايو',
|
|
|
|
|
'يونيو',
|
|
|
|
|
'يوليو',
|
|
|
|
|
'أغسطس',
|
|
|
|
|
'سبتمبر',
|
|
|
|
|
'أكتوبر',
|
|
|
|
|
'نوفمبر',
|
|
|
|
|
'ديسمبر',
|
|
|
|
|
];
|
2014-08-21 02:41:50 +08:00
|
|
|
|
|
2018-04-26 15:15:53 +08:00
|
|
|
|
var ar = moment.defineLocale('ar', {
|
2020-11-11 09:34:26 +08:00
|
|
|
|
months: months,
|
|
|
|
|
monthsShort: months,
|
|
|
|
|
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
|
|
|
|
|
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
|
|
|
|
|
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
|
|
|
|
|
weekdaysParseExact: true,
|
|
|
|
|
longDateFormat: {
|
|
|
|
|
LT: 'HH:mm',
|
|
|
|
|
LTS: 'HH:mm:ss',
|
|
|
|
|
L: 'D/\u200FM/\u200FYYYY',
|
|
|
|
|
LL: 'D MMMM YYYY',
|
|
|
|
|
LLL: 'D MMMM YYYY HH:mm',
|
|
|
|
|
LLLL: 'dddd D MMMM YYYY HH:mm',
|
2018-04-26 15:15:53 +08:00
|
|
|
|
},
|
|
|
|
|
meridiemParse: /ص|م/,
|
2020-11-11 09:34:26 +08:00
|
|
|
|
isPM: function (input) {
|
2018-04-26 15:15:53 +08:00
|
|
|
|
return 'م' === input;
|
|
|
|
|
},
|
2020-11-11 09:34:26 +08:00
|
|
|
|
meridiem: function (hour, minute, isLower) {
|
2018-04-26 15:15:53 +08:00
|
|
|
|
if (hour < 12) {
|
|
|
|
|
return 'ص';
|
|
|
|
|
} else {
|
|
|
|
|
return 'م';
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-11-11 09:34:26 +08:00
|
|
|
|
calendar: {
|
2018-04-26 15:15:53 +08:00
|
|
|
|
sameDay: '[اليوم عند الساعة] LT',
|
|
|
|
|
nextDay: '[غدًا عند الساعة] LT',
|
|
|
|
|
nextWeek: 'dddd [عند الساعة] LT',
|
|
|
|
|
lastDay: '[أمس عند الساعة] LT',
|
|
|
|
|
lastWeek: 'dddd [عند الساعة] LT',
|
2020-11-11 09:34:26 +08:00
|
|
|
|
sameElse: 'L',
|
2018-04-26 15:15:53 +08:00
|
|
|
|
},
|
2020-11-11 09:34:26 +08:00
|
|
|
|
relativeTime: {
|
|
|
|
|
future: 'بعد %s',
|
|
|
|
|
past: 'منذ %s',
|
|
|
|
|
s: pluralize('s'),
|
|
|
|
|
ss: pluralize('s'),
|
|
|
|
|
m: pluralize('m'),
|
|
|
|
|
mm: pluralize('m'),
|
|
|
|
|
h: pluralize('h'),
|
|
|
|
|
hh: pluralize('h'),
|
|
|
|
|
d: pluralize('d'),
|
|
|
|
|
dd: pluralize('d'),
|
|
|
|
|
M: pluralize('M'),
|
|
|
|
|
MM: pluralize('M'),
|
|
|
|
|
y: pluralize('y'),
|
|
|
|
|
yy: pluralize('y'),
|
2018-04-26 15:15:53 +08:00
|
|
|
|
},
|
|
|
|
|
preparse: function (string) {
|
2020-11-11 09:34:26 +08:00
|
|
|
|
return string
|
|
|
|
|
.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
|
|
|
|
|
return numberMap[match];
|
|
|
|
|
})
|
|
|
|
|
.replace(/،/g, ',');
|
2018-04-26 15:15:53 +08:00
|
|
|
|
},
|
|
|
|
|
postformat: function (string) {
|
2020-11-11 09:34:26 +08:00
|
|
|
|
return string
|
|
|
|
|
.replace(/\d/g, function (match) {
|
|
|
|
|
return symbolMap[match];
|
|
|
|
|
})
|
|
|
|
|
.replace(/,/g, '،');
|
|
|
|
|
},
|
|
|
|
|
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 15:15:53 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2016-02-06 04:42:48 +08:00
|
|
|
|
|
2018-04-26 15:15:53 +08:00
|
|
|
|
return ar;
|
2016-02-06 04:42:48 +08:00
|
|
|
|
|
2017-04-20 12:24:20 +08:00
|
|
|
|
})));
|