[TemporaryStorage] add files required for SDK build
[samples/web/TemporaryStorage.git] / tizen-web-ui-fw / latest / js / cultures / globalize.culture.ur.js
1 /*
2  * Globalize Culture ur
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( "ur", "default", {
29         name: "ur",
30         englishName: "Urdu",
31         nativeName: "اُردو",
32         language: "ur",
33         isRTL: true,
34         numberFormat: {
35                 currency: {
36                         pattern: ["$n-","$n"],
37                         symbol: "Rs"
38                 }
39         },
40         calendars: {
41                 standard: {
42                         firstDay: 1,
43                         days: {
44                                 names: ["اتوار","پير","منگل","بدھ","جمعرات","جمعه","هفته"],
45                                 namesAbbr: ["اتوار","پير","منگل","بدھ","جمعرات","جمعه","هفته"],
46                                 namesShort: ["ا","پ","م","ب","ج","ج","ه"]
47                         },
48                         months: {
49                                 names: ["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر",""],
50                                 namesAbbr: ["جنوری","فروری","مارچ","اپریل","مئی","جون","جولائی","اگست","ستمبر","اکتوبر","نومبر","دسمبر",""]
51                         },
52                         patterns: {
53                                 d: "dd/MM/yyyy",
54                                 D: "dd MMMM, yyyy",
55                                 f: "dd MMMM, yyyy h:mm tt",
56                                 F: "dd MMMM, yyyy h:mm:ss tt",
57                                 M: "dd MMMM"
58                         }
59                 },
60                 Hijri: {
61                         name: "Hijri",
62                         firstDay: 1,
63                         days: {
64                                 names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
65                                 namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
66                                 namesShort: ["ح","ن","ث","ر","خ","ج","س"]
67                         },
68                         months: {
69                                 names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
70                                 namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
71                         },
72                         eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
73                         twoDigitYearMax: 1451,
74                         patterns: {
75                                 d: "dd/MM/yy",
76                                 D: "dd/MM/yyyy",
77                                 f: "dd/MM/yyyy h:mm tt",
78                                 F: "dd/MM/yyyy h:mm:ss tt",
79                                 M: "dd MMMM"
80                         },
81                         convert: {
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.
92                     hijriAdjustment: 0,
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());
101                         return gdate;
102                     },
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) {
114                             hyear--;
115                             absDays -= daysInYear;
116                         }
117                         else if (daysSinceJan0101 === absDays) {
118                             hyear--;
119                             absDays = this.daysToYear(hyear);
120                         }
121                         else {
122                             if (daysSinceJan0101 > (absDays + daysInYear)) {
123                                 absDays += daysInYear;
124                                 hyear++;
125                             }
126                         }
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.
129                         hmonth = 0;
130                         var daysIntoYear = daysSinceJan0101 - absDays;
131                         while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
132                             hmonth++;
133                         }
134                         hmonth--;
135                         hday = daysIntoYear - this.monthDays[hmonth];
136                         return [hyear, hmonth, hday];
137                     },
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);
145                             yearsInto30--;
146                         }
147                         return days;
148                     },
149                     isLeapYear: function(year) {
150                         return ((((year * 11) + 14) % 30) < 11);
151                     }
152                         }
153                 }
154         }
155 });
156
157 }( this ));