4 * http://github.com/jquery/globalize
6 * Copyright Software Freedom Conservancy, Inc.
7 * Dual licensed under the MIT or GPL Version 2 licenses.
8 * http://jquery.org/license
10 * This file was generated by the Globalize Culture Generator
11 * Translation: bugs found in this file need to be fixed in the generator
14 (function( window, undefined ) {
18 if ( typeof require !== "undefined"
19 && typeof exports !== "undefined"
20 && typeof module !== "undefined" ) {
22 Globalize = require( "globalize" );
25 Globalize = window.Globalize;
28 Globalize.addCultureInfo( "fa", "default", {
30 englishName: "Persian",
37 pattern: ["$n-","$ n"],
44 name: "Gregorian_TransliteratedFrench",
47 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
48 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
49 namesShort: ["ح","ن","ث","ر","خ","ج","س"]
52 names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
53 namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
55 AM: ["ق.ظ","ق.ظ","ق.ظ"],
56 PM: ["ب.ظ","ب.ظ","ب.ظ"],
57 eras: [{"name":"م","start":null,"offset":0}],
62 f: "dddd, MMMM dd, yyyy hh:mm tt",
63 F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
66 Gregorian_Localized: {
69 names: ["يكشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],
70 namesAbbr: ["يكشنبه","دوشنبه","سه شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],
71 namesShort: ["ی","د","س","چ","پ","ج","ش"]
74 names: ["ژانويه","فوريه","مارس","آوريل","مى","ژوئن","ژوئيه","اوت","سپتامبر","اُكتبر","نوامبر","دسامبر",""],
75 namesAbbr: ["ژانويه","فوريه","مارس","آوريل","مى","ژوئن","ژوئيه","اوت","سپتامبر","اُكتبر","نوامبر","دسامبر",""]
77 AM: ["ق.ظ","ق.ظ","ق.ظ"],
78 PM: ["ب.ظ","ب.ظ","ب.ظ"],
84 f: "yyyy/MM/dd hh:mm tt",
85 F: "yyyy/MM/dd hh:mm:ss tt",
93 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
94 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
95 namesShort: ["ح","ن","ث","ر","خ","ج","س"]
98 names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
99 namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
101 AM: ["ق.ظ","ق.ظ","ق.ظ"],
102 PM: ["ب.ظ","ب.ظ","ب.ظ"],
103 eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
104 twoDigitYearMax: 1451,
110 f: "dd/MM/yyyy hh:mm tt",
111 F: "dd/MM/yyyy hh:mm:ss tt",
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.
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());
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) {
148 absDays -= daysInYear;
150 else if (daysSinceJan0101 === absDays) {
152 absDays = this.daysToYear(hyear);
155 if (daysSinceJan0101 > (absDays + daysInYear)) {
156 absDays += daysInYear;
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.
163 var daysIntoYear = daysSinceJan0101 - absDays;
164 while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
168 hday = daysIntoYear - this.monthDays[hmonth];
169 return [hyear, hmonth, hday];
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);
182 isLeapYear: function(year) {
183 return ((((year * 11) + 14) % 30) < 11);
187 Gregorian_TransliteratedEnglish: {
188 name: "Gregorian_TransliteratedEnglish",
191 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
192 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
193 namesShort: ["أ","ا","ث","أ","خ","ج","س"]
196 names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
197 namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
199 AM: ["ق.ظ","ق.ظ","ق.ظ"],
200 PM: ["ب.ظ","ب.ظ","ب.ظ"],
201 eras: [{"name":"م","start":null,"offset":0}],
206 f: "dddd, MMMM dd, yyyy hh:mm tt",
207 F: "dddd, MMMM dd, yyyy hh:mm:ss tt"