2 * Globalize Culture dv-MV
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( "dv-MV", "default", {
30 englishName: "Divehi (Maldives)",
31 nativeName: "ދިވެހިބަސް (ދިވެހި ރާއްޖެ)",
36 pattern: ["n $-","n $"],
44 names: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
45 namesAbbr: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
46 namesShort: ["އާ","ހޯ","އަ","ބު","ބު","ހު","ހޮ"]
49 names: ["މުޙައްރަމް","ޞަފަރު","ރަބީޢުލްއައްވަލް","ރަބީޢުލްއާޚިރު","ޖުމާދަލްއޫލާ","ޖުމާދަލްއާޚިރާ","ރަޖަބް","ޝަޢްބާން","ރަމަޟާން","ޝައްވާލް","ޛުލްޤަޢިދާ","ޛުލްޙިއްޖާ",""],
50 namesAbbr: ["މުޙައްރަމް","ޞަފަރު","ރަބީޢުލްއައްވަލް","ރަބީޢުލްއާޚިރު","ޖުމާދަލްއޫލާ","ޖުމާދަލްއާޚިރާ","ރަޖަބް","ޝަޢްބާން","ރަމަޟާން","ޝައްވާލް","ޛުލްޤަޢިދާ","ޛުލްޙިއްޖާ",""]
54 eras: [{"name":"ހިޖްރީ","start":null,"offset":0}],
55 twoDigitYearMax: 1451,
61 f: "dd/MM/yyyy HH:mm",
62 F: "dd/MM/yyyy HH:mm:ss",
66 // Adapted to Script from System.Globalization.HijriCalendar
67 ticks1970: 62135596800000,
68 // number of days leading up to each month
69 monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
70 minDate: -42521673600000,
71 maxDate: 253402300799999,
72 // The number of days to add or subtract from the calendar to accommodate the variances
73 // in the start and the end of Ramadan and to accommodate the date difference between
74 // countries/regions. May be dynamically adjusted based on user preference, but should
75 // remain in the range of -2 to 2, inclusive.
77 toGregorian: function(hyear, hmonth, hday) {
78 var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
79 // 86400000 = ticks per day
80 var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
81 // adjust for timezone, because we are interested in the gregorian date for the same timezone
82 // but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
83 // date in the current timezone.
84 gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
87 fromGregorian: function(gdate) {
88 if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
89 var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
90 daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
91 // very particular formula determined by someone smart, adapted from the server-side implementation.
92 // it approximates the hijri year.
93 var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
94 absDays = this.daysToYear(hyear),
95 daysInYear = this.isLeapYear(hyear) ? 355 : 354;
96 // hyear is just approximate, it may need adjustment up or down by 1.
97 if (daysSinceJan0101 < absDays) {
99 absDays -= daysInYear;
101 else if (daysSinceJan0101 === absDays) {
103 absDays = this.daysToYear(hyear);
106 if (daysSinceJan0101 > (absDays + daysInYear)) {
107 absDays += daysInYear;
111 // determine month by looking at how many days into the hyear we are
112 // monthDays contains the number of days up to each month.
114 var daysIntoYear = daysSinceJan0101 - absDays;
115 while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
119 hday = daysIntoYear - this.monthDays[hmonth];
120 return [hyear, hmonth, hday];
122 daysToYear: function(year) {
123 // calculates how many days since Jan 1, 0001
124 var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
125 yearsInto30 = year - yearsToYear30 - 1,
126 days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
127 while (yearsInto30 > 0) {
128 days += (this.isLeapYear(yearsInto30) ? 355 : 354);
133 isLeapYear: function(year) {
134 return ((((year * 11) + 14) % 30) < 11);
138 Gregorian_Localized: {
140 names: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
141 namesAbbr: ["އާދީއްތަ","ހޯމަ","އަންގާރަ","ބުދަ","ބުރާސްފަތި","ހުކުރު","ހޮނިހިރު"],
142 namesShort: ["އާ","ހޯ","އަ","ބު","ބު","ހު","ހޮ"]
145 names: ["ޖަނަވަރީ","ފެބްރުއަރީ","މާޗް","އޭޕްރިލް","މެއި","ޖޫން","ޖުލައި","އޯގަސްޓް","ސެޕްޓެމްބަރ","އޮކްޓޯބަރ","ނޮވެމްބަރ","ޑިސެމްބަރ",""],
146 namesAbbr: ["ޖަނަވަރީ","ފެބްރުއަރީ","މާޗް","އޭޕްރިލް","މެއި","ޖޫން","ޖުލައި","އޯގަސްޓް","ސެޕްޓެމްބަރ","އޮކްޓޯބަރ","ނޮވެމްބަރ","ޑިސެމްބަރ",""]
148 AM: ["މކ","މކ","މކ"],
149 PM: ["މފ","މފ","މފ"],
150 eras: [{"name":"މީލާދީ","start":null,"offset":0}],
153 D: "ddd, yyyy MMMM dd",
156 f: "ddd, yyyy MMMM dd HH:mm",
157 F: "ddd, yyyy MMMM dd HH:mm:ss",