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( "ps", "default", {
30 englishName: "Pashto",
39 negativeInfinity: "-∞",
40 positiveInfinity: "∞",
42 pattern: ["%n-","%n"],
47 pattern: ["$n-","$n"],
58 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
59 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
60 namesShort: ["ح","ن","ث","ر","خ","ج","س"]
63 names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
64 namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
66 AM: ["غ.م","غ.م","غ.م"],
67 PM: ["غ.و","غ.و","غ.و"],
68 eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
69 twoDigitYearMax: 1451,
73 f: "dd/MM/yyyy h:mm tt",
74 F: "dd/MM/yyyy h:mm:ss tt",
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.
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());
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) {
111 absDays -= daysInYear;
113 else if (daysSinceJan0101 === absDays) {
115 absDays = this.daysToYear(hyear);
118 if (daysSinceJan0101 > (absDays + daysInYear)) {
119 absDays += daysInYear;
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.
126 var daysIntoYear = daysSinceJan0101 - absDays;
127 while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
131 hday = daysIntoYear - this.monthDays[hmonth];
132 return [hyear, hmonth, hday];
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);
145 isLeapYear: function(year) {
146 return ((((year * 11) + 14) % 30) < 11);
150 Gregorian_Localized: {
153 names: ["یکشنبه","دوشنبه","سهشنبه","چارشنبه","پنجشنبه","جمعه","شنبه"],
154 namesAbbr: ["یکشنبه","دوشنبه","سهشنبه","چارشنبه","پنجشنبه","جمعه","شنبه"],
155 namesShort: ["ی","د","س","چ","پ","ج","ش"]
158 names: ["سلواغه","كب","ورى","غويى","غبرګولى","چنګا ښزمرى","زمرى","وږى","تله","لړم","لنڈ ۍ","مرغومى",""],
159 namesAbbr: ["سلواغه","كب","ورى","غويى","غبرګولى","چنګا ښ","زمرى","وږى","تله","لړم","لنڈ ۍ","مرغومى",""]
161 AM: ["غ.م","غ.م","غ.م"],
162 PM: ["غ.و","غ.و","غ.و"],
163 eras: [{"name":"ل.ه","start":null,"offset":0}],
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",