Export 0.1.45
[framework/web/web-ui-fw.git] / libs / js / globalize / lib / cultures / globalize.culture.fa.js
1 /*
2  * Globalize Culture fa
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( "fa", "default", {
29         name: "fa",
30         englishName: "Persian",
31         nativeName: "فارسى",
32         language: "fa",
33         isRTL: true,
34         numberFormat: {
35                 pattern: ["n-"],
36                 currency: {
37                         pattern: ["$n-","$ n"],
38                         ".": "/",
39                         symbol: "ريال"
40                 }
41         },
42         calendars: {
43                 standard: {
44                         name: "Gregorian_TransliteratedFrench",
45                         firstDay: 6,
46                         days: {
47                                 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
48                                 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
49                                 namesShort: ["ح","ن","ث","ر","خ","ج","س"]
50                         },
51                         months: {
52                                 names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
53                                 namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
54                         },
55                         AM: ["ق.ظ","ق.ظ","ق.ظ"],
56                         PM: ["ب.ظ","ب.ظ","ب.ظ"],
57                         eras: [{"name":"م","start":null,"offset":0}],
58                         patterns: {
59                                 d: "MM/dd/yyyy",
60                                 t: "hh:mm tt",
61                                 T: "hh:mm:ss tt",
62                                 f: "dddd, MMMM dd, yyyy hh:mm tt",
63                                 F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
64                         }
65                 },
66                 Gregorian_Localized: {
67                         firstDay: 6,
68                         days: {
69                                 names: ["يكشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],
70                                 namesAbbr: ["يكشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],
71                                 namesShort: ["ی","د","س","چ","پ","ج","ش"]
72                         },
73                         months: {
74                                 names: ["ژانويه","فوريه","مارس","آوريل","مى","ژوئن","ژوئيه","اوت","سپتامبر","اُكتبر","نوامبر","دسامبر",""],
75                                 namesAbbr: ["ژانويه","فوريه","مارس","آوريل","مى","ژوئن","ژوئيه","اوت","سپتامبر","اُكتبر","نوامبر","دسامبر",""]
76                         },
77                         AM: ["ق.ظ","ق.ظ","ق.ظ"],
78                         PM: ["ب.ظ","ب.ظ","ب.ظ"],
79                         patterns: {
80                                 d: "yyyy/MM/dd",
81                                 D: "yyyy/MM/dd",
82                                 t: "hh:mm tt",
83                                 T: "hh:mm:ss tt",
84                                 f: "yyyy/MM/dd hh:mm tt",
85                                 F: "yyyy/MM/dd hh:mm:ss tt",
86                                 M: "dd MMMM"
87                         }
88                 },
89                 Hijri: {
90                         name: "Hijri",
91                         firstDay: 6,
92                         days: {
93                                 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
94                                 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
95                                 namesShort: ["ح","ن","ث","ر","خ","ج","س"]
96                         },
97                         months: {
98                                 names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
99                                 namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
100                         },
101                         AM: ["ق.ظ","ق.ظ","ق.ظ"],
102                         PM: ["ب.ظ","ب.ظ","ب.ظ"],
103                         eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
104                         twoDigitYearMax: 1451,
105                         patterns: {
106                                 d: "dd/MM/yy",
107                                 D: "dd/MM/yyyy",
108                                 t: "hh:mm tt",
109                                 T: "hh:mm:ss tt",
110                                 f: "dd/MM/yyyy hh:mm tt",
111                                 F: "dd/MM/yyyy hh:mm:ss tt",
112                                 M: "dd MMMM"
113                         },
114                         convert: {
115                     // Adapted to Script from System.Globalization.HijriCalendar
116                     ticks1970: 62135596800000,
117                     // number of days leading up to each month
118                     monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
119                     minDate: -42521673600000,
120                     maxDate: 253402300799999,
121                     // The number of days to add or subtract from the calendar to accommodate the variances
122                     // in the start and the end of Ramadan and to accommodate the date difference between
123                     // countries/regions. May be dynamically adjusted based on user preference, but should
124                     // remain in the range of -2 to 2, inclusive.
125                     hijriAdjustment: 0,
126                     toGregorian: function(hyear, hmonth, hday) {
127                         var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
128                         // 86400000 = ticks per day
129                         var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
130                         // adjust for timezone, because we are interested in the gregorian date for the same timezone
131                         // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
132                         // date in the current timezone.
133                         gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
134                         return gdate;
135                     },
136                     fromGregorian: function(gdate) {
137                         if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
138                         var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
139                             daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
140                         // very particular formula determined by someone smart, adapted from the server-side implementation.
141                         // it approximates the hijri year.
142                         var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
143                             absDays = this.daysToYear(hyear),
144                             daysInYear = this.isLeapYear(hyear) ? 355 : 354;
145                         // hyear is just approximate, it may need adjustment up or down by 1.
146                         if (daysSinceJan0101 < absDays) {
147                             hyear--;
148                             absDays -= daysInYear;
149                         }
150                         else if (daysSinceJan0101 === absDays) {
151                             hyear--;
152                             absDays = this.daysToYear(hyear);
153                         }
154                         else {
155                             if (daysSinceJan0101 > (absDays + daysInYear)) {
156                                 absDays += daysInYear;
157                                 hyear++;
158                             }
159                         }
160                         // determine month by looking at how many days into the hyear we are
161                         // monthDays contains the number of days up to each month.
162                         hmonth = 0;
163                         var daysIntoYear = daysSinceJan0101 - absDays;
164                         while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
165                             hmonth++;
166                         }
167                         hmonth--;
168                         hday = daysIntoYear - this.monthDays[hmonth];
169                         return [hyear, hmonth, hday];
170                     },
171                     daysToYear: function(year) {
172                         // calculates how many days since Jan 1, 0001
173                         var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
174                             yearsInto30 = year - yearsToYear30 - 1,
175                             days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
176                         while (yearsInto30 > 0) {
177                             days += (this.isLeapYear(yearsInto30) ? 355 : 354);
178                             yearsInto30--;
179                         }
180                         return days;
181                     },
182                     isLeapYear: function(year) {
183                         return ((((year * 11) + 14) % 30) < 11);
184                     }
185                         }
186                 },
187                 Gregorian_TransliteratedEnglish: {
188                         name: "Gregorian_TransliteratedEnglish",
189                         firstDay: 6,
190                         days: {
191                                 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
192                                 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
193                                 namesShort: ["أ","ا","ث","أ","خ","ج","س"]
194                         },
195                         months: {
196                                 names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
197                                 namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
198                         },
199                         AM: ["ق.ظ","ق.ظ","ق.ظ"],
200                         PM: ["ب.ظ","ب.ظ","ب.ظ"],
201                         eras: [{"name":"م","start":null,"offset":0}],
202                         patterns: {
203                                 d: "MM/dd/yyyy",
204                                 t: "hh:mm tt",
205                                 T: "hh:mm:ss tt",
206                                 f: "dddd, MMMM dd, yyyy hh:mm tt",
207                                 F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
208                         }
209                 }
210         }
211 });
212
213 }( this ));