2 * Globalize Culture prs-AF
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( "prs-AF", "default", {
30 englishName: "Dari (Afghanistan)",
31 nativeName: "درى (افغانستان)",
39 negativeInfinity: "-∞",
40 positiveInfinity: "∞",
42 pattern: ["%n-","%n"],
47 pattern: ["$n-","$n"],
56 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
57 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
58 namesShort: ["ح","ن","ث","ر","خ","ج","س"]
61 names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
62 namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
64 AM: ["غ.م","غ.م","غ.م"],
65 PM: ["غ.و","غ.و","غ.و"],
66 eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
67 twoDigitYearMax: 1451,
71 f: "dd/MM/yyyy h:mm tt",
72 F: "dd/MM/yyyy h:mm:ss tt",
76 // Adapted to Script from System.Globalization.HijriCalendar
77 ticks1970: 62135596800000,
78 // number of days leading up to each month
79 monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
80 minDate: -42521673600000,
81 maxDate: 253402300799999,
82 // The number of days to add or subtract from the calendar to accommodate the variances
83 // in the start and the end of Ramadan and to accommodate the date difference between
84 // countries/regions. May be dynamically adjusted based on user preference, but should
85 // remain in the range of -2 to 2, inclusive.
87 toGregorian: function(hyear, hmonth, hday) {
88 var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
89 // 86400000 = ticks per day
90 var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
91 // adjust for timezone, because we are interested in the gregorian date for the same timezone
92 // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
93 // date in the current timezone.
94 gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
97 fromGregorian: function(gdate) {
98 if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
99 var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
100 daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
101 // very particular formula determined by someone smart, adapted from the server-side implementation.
102 // it approximates the hijri year.
103 var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
104 absDays = this.daysToYear(hyear),
105 daysInYear = this.isLeapYear(hyear) ? 355 : 354;
106 // hyear is just approximate, it may need adjustment up or down by 1.
107 if (daysSinceJan0101 < absDays) {
109 absDays -= daysInYear;
111 else if (daysSinceJan0101 === absDays) {
113 absDays = this.daysToYear(hyear);
116 if (daysSinceJan0101 > (absDays + daysInYear)) {
117 absDays += daysInYear;
121 // determine month by looking at how many days into the hyear we are
122 // monthDays contains the number of days up to each month.
124 var daysIntoYear = daysSinceJan0101 - absDays;
125 while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
129 hday = daysIntoYear - this.monthDays[hmonth];
130 return [hyear, hmonth, hday];
132 daysToYear: function(year) {
133 // calculates how many days since Jan 1, 0001
134 var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
135 yearsInto30 = year - yearsToYear30 - 1,
136 days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
137 while (yearsInto30 > 0) {
138 days += (this.isLeapYear(yearsInto30) ? 355 : 354);
143 isLeapYear: function(year) {
144 return ((((year * 11) + 14) % 30) < 11);
148 Gregorian_Localized: {
151 names: ["یکشنبه","دوشنبه","سهشنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],
152 namesAbbr: ["یکشنبه","دوشنبه","سهشنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],
153 namesShort: ["ی","د","س","چ","پ","ج","ش"]
156 names: ["سلواغه","كب","ورى","غويى","غبرګولى","چنګاښ","زمرى","وږى","تله","لړم","ليندۍ","مرغومى",""],
157 namesAbbr: ["سلواغه","كب","ورى","غويى","غبرګولى","چنګاښ","زمرى","وږى","تله","لړم","ليندۍ","مرغومى",""]
159 AM: ["غ.م","غ.م","غ.م"],
160 PM: ["غ.و","غ.و","غ.و"],
161 eras: [{"name":"ل.ه","start":null,"offset":0}],
164 D: "yyyy, dd, MMMM, dddd",
165 f: "yyyy, dd, MMMM, dddd h:mm tt",
166 F: "yyyy, dd, MMMM, dddd h:mm:ss tt",