2 * Globalize Culture ur-PK
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( "ur-PK", "default", {
30 englishName: "Urdu (Islamic Republic of Pakistan)",
31 nativeName: "اُردو (پاکستان)",
36 pattern: ["$n-","$n"],
44 names: ["اتوار","پير","منگل","بدھ","جمعرات","جمعه","هفته"],
45 namesAbbr: ["اتوار","پير","منگل","بدھ","جمعرات","جمعه","هفته"],
46 namesShort: ["ا","پ","م","ب","ج","ج","ه"]
49 names: ["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر",""],
50 namesAbbr: ["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر",""]
55 f: "dd MMMM, yyyy h:mm tt",
56 F: "dd MMMM, yyyy h:mm:ss tt",
64 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
65 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
66 namesShort: ["ح","ن","ث","ر","خ","ج","س"]
69 names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
70 namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
72 eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
73 twoDigitYearMax: 1451,
77 f: "dd/MM/yyyy h:mm tt",
78 F: "dd/MM/yyyy h:mm:ss tt",
82 // Adapted to Script from System.Globalization.HijriCalendar
83 ticks1970: 62135596800000,
84 // number of days leading up to each month
85 monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
86 minDate: -42521673600000,
87 maxDate: 253402300799999,
88 // The number of days to add or subtract from the calendar to accommodate the variances
89 // in the start and the end of Ramadan and to accommodate the date difference between
90 // countries/regions. May be dynamically adjusted based on user preference, but should
91 // remain in the range of -2 to 2, inclusive.
93 toGregorian: function(hyear, hmonth, hday) {
94 var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
95 // 86400000 = ticks per day
96 var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
97 // adjust for timezone, because we are interested in the gregorian date for the same timezone
98 // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
99 // date in the current timezone.
100 gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
103 fromGregorian: function(gdate) {
104 if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
105 var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
106 daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
107 // very particular formula determined by someone smart, adapted from the server-side implementation.
108 // it approximates the hijri year.
109 var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
110 absDays = this.daysToYear(hyear),
111 daysInYear = this.isLeapYear(hyear) ? 355 : 354;
112 // hyear is just approximate, it may need adjustment up or down by 1.
113 if (daysSinceJan0101 < absDays) {
115 absDays -= daysInYear;
117 else if (daysSinceJan0101 === absDays) {
119 absDays = this.daysToYear(hyear);
122 if (daysSinceJan0101 > (absDays + daysInYear)) {
123 absDays += daysInYear;
127 // determine month by looking at how many days into the hyear we are
128 // monthDays contains the number of days up to each month.
130 var daysIntoYear = daysSinceJan0101 - absDays;
131 while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
135 hday = daysIntoYear - this.monthDays[hmonth];
136 return [hyear, hmonth, hday];
138 daysToYear: function(year) {
139 // calculates how many days since Jan 1, 0001
140 var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
141 yearsInto30 = year - yearsToYear30 - 1,
142 days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
143 while (yearsInto30 > 0) {
144 days += (this.isLeapYear(yearsInto30) ? 355 : 354);
149 isLeapYear: function(year) {
150 return ((((year * 11) + 14) % 30) < 11);