Revert "Export"
[framework/web/web-ui-fw.git] / libs / js / globalize / lib / cultures / globalize.culture.ps.js
1 /*
2  * Globalize Culture ps
3  *
4  * http://github.com/jquery/globalize
5  *
6  * Copyright Software Freedom Conservancy, Inc.
7  * Dual licensed under the MIT or GPL Version 2 licenses.
8  * http://jquery.org/license
9  *
10  * This file was generated by the Globalize Culture Generator
11  * Translation: bugs found in this file need to be fixed in the generator
12  */
13
14 (function( window, undefined ) {
15
16 var Globalize;
17
18 if ( typeof require !== "undefined"
19         && typeof exports !== "undefined"
20         && typeof module !== "undefined" ) {
21         // Assume CommonJS
22         Globalize = require( "globalize" );
23 } else {
24         // Global variable
25         Globalize = window.Globalize;
26 }
27
28 Globalize.addCultureInfo( "ps", "default", {
29         name: "ps",
30         englishName: "Pashto",
31         nativeName: "پښتو",
32         language: "ps",
33         isRTL: true,
34         numberFormat: {
35                 pattern: ["n-"],
36                 ",": "،",
37                 ".": ",",
38                 NaN: "غ ع",
39                 negativeInfinity: "-∞",
40                 positiveInfinity: "∞",
41                 percent: {
42                         pattern: ["%n-","%n"],
43                         ",": "،",
44                         ".": ","
45                 },
46                 currency: {
47                         pattern: ["$n-","$n"],
48                         ",": "٬",
49                         ".": "٫",
50                         symbol: "؋"
51                 }
52         },
53         calendars: {
54                 standard: {
55                         name: "Hijri",
56                         firstDay: 6,
57                         days: {
58                                 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
59                                 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
60                                 namesShort: ["ح","ن","ث","ر","خ","ج","س"]
61                         },
62                         months: {
63                                 names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
64                                 namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
65                         },
66                         AM: ["غ.م","غ.م","غ.م"],
67                         PM: ["غ.و","غ.و","غ.و"],
68                         eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
69                         twoDigitYearMax: 1451,
70                         patterns: {
71                                 d: "dd/MM/yy",
72                                 D: "dd/MM/yyyy",
73                                 f: "dd/MM/yyyy h:mm tt",
74                                 F: "dd/MM/yyyy h:mm:ss tt",
75                                 M: "dd MMMM"
76                         },
77                         convert: {
78                     // Adapted to Script from System.Globalization.HijriCalendar
79                     ticks1970: 62135596800000,
80                     // number of days leading up to each month
81                     monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
82                     minDate: -42521673600000,
83                     maxDate: 253402300799999,
84                     // The number of days to add or subtract from the calendar to accommodate the variances
85                     // in the start and the end of Ramadan and to accommodate the date difference between
86                     // countries/regions. May be dynamically adjusted based on user preference, but should
87                     // remain in the range of -2 to 2, inclusive.
88                     hijriAdjustment: 0,
89                     toGregorian: function(hyear, hmonth, hday) {
90                         var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
91                         // 86400000 = ticks per day
92                         var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
93                         // adjust for timezone, because we are interested in the gregorian date for the same timezone
94                         // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
95                         // date in the current timezone.
96                         gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
97                         return gdate;
98                     },
99                     fromGregorian: function(gdate) {
100                         if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
101                         var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
102                             daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
103                         // very particular formula determined by someone smart, adapted from the server-side implementation.
104                         // it approximates the hijri year.
105                         var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
106                             absDays = this.daysToYear(hyear),
107                             daysInYear = this.isLeapYear(hyear) ? 355 : 354;
108                         // hyear is just approximate, it may need adjustment up or down by 1.
109                         if (daysSinceJan0101 < absDays) {
110                             hyear--;
111                             absDays -= daysInYear;
112                         }
113                         else if (daysSinceJan0101 === absDays) {
114                             hyear--;
115                             absDays = this.daysToYear(hyear);
116                         }
117                         else {
118                             if (daysSinceJan0101 > (absDays + daysInYear)) {
119                                 absDays += daysInYear;
120                                 hyear++;
121                             }
122                         }
123                         // determine month by looking at how many days into the hyear we are
124                         // monthDays contains the number of days up to each month.
125                         hmonth = 0;
126                         var daysIntoYear = daysSinceJan0101 - absDays;
127                         while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
128                             hmonth++;
129                         }
130                         hmonth--;
131                         hday = daysIntoYear - this.monthDays[hmonth];
132                         return [hyear, hmonth, hday];
133                     },
134                     daysToYear: function(year) {
135                         // calculates how many days since Jan 1, 0001
136                         var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
137                             yearsInto30 = year - yearsToYear30 - 1,
138                             days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
139                         while (yearsInto30 > 0) {
140                             days += (this.isLeapYear(yearsInto30) ? 355 : 354);
141                             yearsInto30--;
142                         }
143                         return days;
144                     },
145                     isLeapYear: function(year) {
146                         return ((((year * 11) + 14) % 30) < 11);
147                     }
148                         }
149                 },
150                 Gregorian_Localized: {
151                         firstDay: 6,
152                         days: {
153                                 names: ["یکشنبه","دوشنبه","سه‌شنبه","چارشنبه","پنجشنبه","جمعه","شنبه"],
154                                 namesAbbr: ["یکشنبه","دوشنبه","سه‌شنبه","چارشنبه","پنجشنبه","جمعه","شنبه"],
155                                 namesShort: ["ی","د","س","چ","پ","ج","ش"]
156                         },
157                         months: {
158                                 names: ["سلواغه","كب","ورى","غويى","غبرګولى","چنګا ښزمرى","زمرى","وږى","تله","لړم","لنڈ ۍ","مرغومى",""],
159                                 namesAbbr: ["سلواغه","كب","ورى","غويى","غبرګولى","چنګا ښ","زمرى","وږى","تله","لړم","لنڈ ۍ","مرغومى",""]
160                         },
161                         AM: ["غ.م","غ.م","غ.م"],
162                         PM: ["غ.و","غ.و","غ.و"],
163                         eras: [{"name":"ل.ه","start":null,"offset":0}],
164                         patterns: {
165                                 d: "yyyy/M/d",
166                                 D: "yyyy, dd, MMMM, dddd",
167                                 f: "yyyy, dd, MMMM, dddd h:mm tt",
168                                 F: "yyyy, dd, MMMM, dddd h:mm:ss tt",
169                                 M: "d MMMM",
170                                 Y: "MMMM yyyy"
171                         }
172                 }
173         }
174 });
175
176 }( this ));