| 1 |
define(["dojo/_base/lang", "dojo/_base/declare", "dojo/date", "../islamic/Date"], |
| 2 |
function(lang, declare, dd){ |
| 3 |
|
| 4 |
var IDate = declare("dojox.date.umalqura.Date", null, { |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
_MONTH_LENGTH: [ |
| 14 |
|
| 15 |
"101010101010", "110101010100", "111011001001", "011011010100", "011011101010", |
| 16 |
|
| 17 |
"001101101100", "101010101101", "010101010101", "011010101001", "011110010010", |
| 18 |
|
| 19 |
"101110101001", "010111010100", "101011011010", "010101011100", "110100101101", |
| 20 |
|
| 21 |
"011010010101", "011101001010", "101101010100", "101101101010", "010110101101", |
| 22 |
|
| 23 |
"010010101110", "101001001111", "010100010111", "011010001011", "011010100101", |
| 24 |
|
| 25 |
"101011010101", "001011010110", "100101011011", "010010011101", "101001001101", |
| 26 |
|
| 27 |
"110100100110", "110110010101", "010110101100", "100110110110", "001010111010", |
| 28 |
|
| 29 |
"101001011011", "010100101011", "101010010101", "011011001010", "101011101001", |
| 30 |
|
| 31 |
"001011110100", "100101110110", "001010110110", "100101010110", "101011001010", |
| 32 |
|
| 33 |
"101110100100", "101111010010", "010111011001", "001011011100", "100101101101", |
| 34 |
|
| 35 |
"010101001101", "101010100101", "101101010010", "101110100101", "010110110100", |
| 36 |
|
| 37 |
"100110110110", "010101010111", "001010010111", "010101001011", "011010100011", |
| 38 |
|
| 39 |
"011101010010", "101101100101", "010101101010", "101010101011", "010100101011", |
| 40 |
|
| 41 |
"110010010101", "110101001010", "110110100101", "010111001010", "101011010110", |
| 42 |
|
| 43 |
"100101010111", "010010101011", "100101001011", "101010100101", "101101010010", |
| 44 |
|
| 45 |
"101101101010", "010101110101", "001001110110", "100010110111", "010001011011", |
| 46 |
|
| 47 |
"010101010101", "010110101001", "010110110100", "100111011010", "010011011101", |
| 48 |
|
| 49 |
"001001101110", "100100110110", "101010101010", "110101010100", "110110110010", |
| 50 |
|
| 51 |
"010111010101", "001011011010", "100101011011", "010010101011", "101001010101", |
| 52 |
|
| 53 |
"101101001001", "101101100100", "101101110001", "010110110100", "101010110101", |
| 54 |
|
| 55 |
"101001010101", "110100100101", "111010010010", "111011001001", "011011010100", |
| 56 |
|
| 57 |
"101011101001", "100101101011", "010010101011", "101010010011", "110101001001", |
| 58 |
|
| 59 |
"110110100100", "110110110010", "101010111001", "010010111010", "101001011011", |
| 60 |
|
| 61 |
"010100101011", "101010010101", "101100101010", "101101010101", "010101011100", |
| 62 |
|
| 63 |
"010010111101", "001000111101", "100100011101", "101010010101", "101101001010", |
| 64 |
|
| 65 |
"101101011010", "010101101101", "001010110110", "100100111011", "010010011011", |
| 66 |
|
| 67 |
"011001010101", "011010101001", "011101010100", "101101101010", "010101101100", |
| 68 |
|
| 69 |
"101010101101", "010101010101", "101100101001", "101110010010", "101110101001", |
| 70 |
|
| 71 |
"010111010100", "101011011010", "010101011010", "101010101011", "010110010101", |
| 72 |
|
| 73 |
"011101001001", "011101100100", "101110101010", "010110110101", "001010110110", |
| 74 |
|
| 75 |
"101001010110", "111001001101", "101100100101", "101101010010", "101101101010", |
| 76 |
|
| 77 |
"010110101101", "001010101110", "100100101111", "010010010111", "011001001011", |
| 78 |
|
| 79 |
"011010100101", "011010101100", "101011010110", "010101011101", "010010011101", |
| 80 |
|
| 81 |
"101001001101", "110100010110", "110110010101", "010110101010", "010110110101", |
| 82 |
|
| 83 |
"001011011010", "100101011011", "010010101101", "010110010101", "011011001010", |
| 84 |
|
| 85 |
"011011100100", "101011101010", "010011110101", "001010110110", "100101010110", |
| 86 |
|
| 87 |
"101010101010", "101101010100", "101111010010", "010111011001", "001011101010", |
| 88 |
|
| 89 |
"100101101101", "010010101101", "101010010101", "101101001010", "101110100101", |
| 90 |
|
| 91 |
"010110110010", "100110110101", "010011010110", "101010010111", "010101000111", |
| 92 |
|
| 93 |
"011010010011", "011101001001", "101101010101", "010101101010", "101001101011", |
| 94 |
|
| 95 |
"010100101011", "101010001011", "110101000110", "110110100011", "010111001010", |
| 96 |
|
| 97 |
"101011010110", "010011011011", "001001101011", "100101001011", "101010100101", |
| 98 |
|
| 99 |
"101101010010", "101101101001", "010101110101", "000101110110", "100010110111", |
| 100 |
|
| 101 |
"001001011011", "010100101011", "010101100101", "010110110100", "100111011010", |
| 102 |
|
| 103 |
"010011101101", "000101101101", "100010110110", "101010100110", "110101010010", |
| 104 |
|
| 105 |
"110110101001", "010111010100", "101011011010", "100101011011", "010010101011", |
| 106 |
|
| 107 |
"011001010011", "011100101001", "011101100010", "101110101001", "010110110010", |
| 108 |
|
| 109 |
"101010110101", "010101010101", "101100100101", "110110010010", "111011001001", |
| 110 |
|
| 111 |
"011011010010", "101011101001", "010101101011", "010010101011", "101001010101", |
| 112 |
|
| 113 |
"110100101001", "110101010100", "110110101010", "100110110101", "010010111010", |
| 114 |
|
| 115 |
"101000111011", "010010011011", "101001001101", "101010101010", "101011010101", |
| 116 |
|
| 117 |
"001011011010", "100101011101", "010001011110", "101000101110", "110010011010", |
| 118 |
|
| 119 |
"110101010101", "011010110010", "011010111001", "010010111010", "101001011101", |
| 120 |
|
| 121 |
"010100101101", "101010010101", "101101010010", "101110101000", "101110110100", |
| 122 |
|
| 123 |
"010110111001", "001011011010", "100101011010", "101101001010", "110110100100", |
| 124 |
|
| 125 |
"111011010001", "011011101000", "101101101010", "010101101101", "010100110101", |
| 126 |
|
| 127 |
"011010010101", "110101001010", "110110101000", "110111010100", "011011011010", |
| 128 |
|
| 129 |
"010101011011", "001010011101", "011000101011", "101100010101", "101101001010", |
| 130 |
|
| 131 |
"101110010101", "010110101010", "101010101110", "100100101110", "110010001111", |
| 132 |
|
| 133 |
"010100100111", "011010010101", "011010101010", "101011010110", "010101011101", |
| 134 |
|
| 135 |
"001010011101"], |
| 136 |
|
| 137 |
_hijriBegin: 1300, |
| 138 |
_hijriEnd: 1600, |
| 139 |
_date: 0, |
| 140 |
_month: 0, |
| 141 |
_year: 0, |
| 142 |
_hours: 0, |
| 143 |
_minutes: 0, |
| 144 |
_seconds: 0, |
| 145 |
_milliseconds: 0, |
| 146 |
_day: 0, |
| 147 |
|
| 148 |
constructor: function(){ |
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
var len = arguments.length; |
| 153 |
if(!len){ |
| 154 |
this.fromGregorian(new Date()); |
| 155 |
}else if(len == 1){ |
| 156 |
var arg0 = arguments[0]; |
| 157 |
if(typeof arg0 == "number"){ |
| 158 |
arg0 = new Date(arg0); |
| 159 |
} |
| 160 |
|
| 161 |
if(arg0 instanceof Date){ |
| 162 |
this.fromGregorian(arg0); |
| 163 |
}else if(arg0 == ""){ |
| 164 |
|
| 165 |
this._date = new Date(""); |
| 166 |
}else{ |
| 167 |
this._year = arg0._year; |
| 168 |
this._month = arg0._month; |
| 169 |
this._date = arg0._date; |
| 170 |
this._hours = arg0._hours; |
| 171 |
this._minutes = arg0._minutes; |
| 172 |
this._seconds = arg0._seconds; |
| 173 |
this._milliseconds = arg0._milliseconds; |
| 174 |
} |
| 175 |
}else if(len >= 3){ |
| 176 |
|
| 177 |
this._year += arguments[0]; |
| 178 |
this._month += arguments[1]; |
| 179 |
this._date += arguments[2]; |
| 180 |
this._hours += arguments[3] || 0; |
| 181 |
this._minutes += arguments[4] || 0; |
| 182 |
this._seconds += arguments[5] || 0; |
| 183 |
this._milliseconds += arguments[6] || 0; |
| 184 |
} |
| 185 |
}, |
| 186 |
|
| 187 |
getDate: function(){ |
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
return this._date; |
| 195 |
}, |
| 196 |
|
| 197 |
getMonth: function(){ |
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
return this._month; |
| 206 |
}, |
| 207 |
|
| 208 |
getFullYear: function(){ |
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
return this._year; |
| 217 |
}, |
| 218 |
|
| 219 |
getDay: function(){ |
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
var d = this.toGregorian(); |
| 228 |
var dd = d.getDay(); |
| 229 |
return dd; |
| 230 |
}, |
| 231 |
|
| 232 |
getHours: function(){ |
| 233 |
|
| 234 |
|
| 235 |
return this._hours; |
| 236 |
}, |
| 237 |
|
| 238 |
getMinutes: function(){ |
| 239 |
|
| 240 |
|
| 241 |
return this._minutes; |
| 242 |
}, |
| 243 |
|
| 244 |
getSeconds: function(){ |
| 245 |
|
| 246 |
|
| 247 |
return this._seconds; |
| 248 |
}, |
| 249 |
|
| 250 |
getMilliseconds: function(){ |
| 251 |
|
| 252 |
|
| 253 |
return this._milliseconds; |
| 254 |
}, |
| 255 |
|
| 256 |
setDate: function( date){ |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
date = parseInt(date); |
| 264 |
|
| 265 |
if(date > 0 && date <= this.getDaysInIslamicMonth(this._month, this._year)){ |
| 266 |
this._date = date; |
| 267 |
}else{ |
| 268 |
var mdays; |
| 269 |
if(date > 0){ |
| 270 |
for(mdays = this.getDaysInIslamicMonth(this._month, this._year); |
| 271 |
date > mdays; |
| 272 |
date -= mdays, mdays = this.getDaysInIslamicMonth(this._month, this._year)){ |
| 273 |
this._month++; |
| 274 |
if(this._month >= 12){ this._year++; this._month -= 12; } |
| 275 |
} |
| 276 |
|
| 277 |
this._date = date; |
| 278 |
}else{ |
| 279 |
for(mdays = this.getDaysInIslamicMonth((this._month - 1) >= 0 ? (this._month - 1) : 11, ((this._month - 1) >= 0) ? this._year : this._year - 1); |
| 280 |
date <= 0; |
| 281 |
mdays = this.getDaysInIslamicMonth((this._month - 1) >= 0 ? (this._month - 1) : 11, ((this._month - 1) >= 0) ? this._year : this._year - 1)){ |
| 282 |
this._month--; |
| 283 |
if(this._month < 0){ this._year--; this._month += 12; } |
| 284 |
|
| 285 |
date += mdays; |
| 286 |
} |
| 287 |
this._date = date; |
| 288 |
} |
| 289 |
} |
| 290 |
return this; |
| 291 |
}, |
| 292 |
|
| 293 |
setFullYear: function( year){ |
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
this._year = +year; |
| 301 |
}, |
| 302 |
|
| 303 |
setMonth: function( month){ |
| 304 |
|
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
this._year += Math.floor(month / 12); |
| 311 |
if(month > 0){ |
| 312 |
this._month = Math.floor(month % 12); |
| 313 |
}else{ |
| 314 |
this._month = Math.floor(((month % 12) + 12) % 12); |
| 315 |
} |
| 316 |
}, |
| 317 |
|
| 318 |
setHours: function(){ |
| 319 |
|
| 320 |
|
| 321 |
var hours_arg_no = arguments.length; |
| 322 |
var hours = 0; |
| 323 |
if(hours_arg_no >= 1){ |
| 324 |
hours = parseInt(arguments[0]); |
| 325 |
} |
| 326 |
|
| 327 |
if(hours_arg_no >= 2){ |
| 328 |
this._minutes = parseInt(arguments[1]); |
| 329 |
} |
| 330 |
|
| 331 |
if(hours_arg_no >= 3){ |
| 332 |
this._seconds = parseInt(arguments[2]); |
| 333 |
} |
| 334 |
|
| 335 |
if(hours_arg_no == 4){ |
| 336 |
this._milliseconds = parseInt(arguments[3]); |
| 337 |
} |
| 338 |
|
| 339 |
while (hours >= 24){ |
| 340 |
this._date++; |
| 341 |
var mdays = this.getDaysInIslamicMonth(this._month, this._year); |
| 342 |
if(this._date > mdays){ |
| 343 |
this._month++; |
| 344 |
if(this._month >= 12){ this._year++; this._month -= 12; } |
| 345 |
this._date -= mdays; |
| 346 |
} |
| 347 |
hours -= 24; |
| 348 |
} |
| 349 |
this._hours = hours; |
| 350 |
}, |
| 351 |
|
| 352 |
_addMinutes: function( minutes){ |
| 353 |
minutes += this._minutes; |
| 354 |
this.setMinutes(minutes); |
| 355 |
this.setHours(this._hours + parseInt(minutes / 60)); |
| 356 |
return this; |
| 357 |
}, |
| 358 |
|
| 359 |
_addSeconds: function( seconds){ |
| 360 |
seconds += this._seconds; |
| 361 |
this.setSeconds(seconds); |
| 362 |
this._addMinutes(parseInt(seconds / 60)); |
| 363 |
return this; |
| 364 |
}, |
| 365 |
|
| 366 |
_addMilliseconds: function( milliseconds){ |
| 367 |
milliseconds += this._milliseconds; |
| 368 |
this.setMilliseconds(milliseconds); |
| 369 |
this._addSeconds(parseInt(milliseconds / 1000)); |
| 370 |
return this; |
| 371 |
}, |
| 372 |
|
| 373 |
setMinutes: function( minutes){ |
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
while (minutes >= 60){ |
| 378 |
this._hours++; |
| 379 |
if(this._hours >= 24){ |
| 380 |
this._date++; |
| 381 |
this._hours -= 24; |
| 382 |
var mdays = this.getDaysInIslamicMonth(this._month, this._year); |
| 383 |
if(this._date > mdays){ |
| 384 |
this._month++; |
| 385 |
if(this._month >= 12){ this._year++; this._month -= 12; } |
| 386 |
this._date -= mdays; |
| 387 |
} |
| 388 |
} |
| 389 |
minutes -= 60; |
| 390 |
} |
| 391 |
this._minutes = minutes; |
| 392 |
}, |
| 393 |
|
| 394 |
|
| 395 |
setSeconds: function( seconds){ |
| 396 |
|
| 397 |
|
| 398 |
while (seconds >= 60){ |
| 399 |
this._minutes++; |
| 400 |
if(this._minutes >= 60){ |
| 401 |
this._hours++; |
| 402 |
this._minutes -= 60; |
| 403 |
if(this._hours >= 24){ |
| 404 |
this._date++; |
| 405 |
this._hours -= 24; |
| 406 |
var mdays = this.getDaysInIslamicMonth(this._month, this._year); |
| 407 |
if(this._date > mdays){ |
| 408 |
this._month++; |
| 409 |
if(this._month >= 12){ this._year++; this._month -= 12; } |
| 410 |
this._date -= mdays; |
| 411 |
} |
| 412 |
} |
| 413 |
} |
| 414 |
seconds -= 60; |
| 415 |
} |
| 416 |
this._seconds = seconds; |
| 417 |
}, |
| 418 |
|
| 419 |
setMilliseconds: function( milliseconds){ |
| 420 |
|
| 421 |
|
| 422 |
while (milliseconds >= 1000){ |
| 423 |
this.setSeconds++; |
| 424 |
if(this.setSeconds >= 60){ |
| 425 |
this._minutes++; |
| 426 |
this.setSeconds -= 60; |
| 427 |
if(this._minutes >= 60){ |
| 428 |
this._hours++; |
| 429 |
this._minutes -= 60; |
| 430 |
if(this._hours >= 24){ |
| 431 |
this._date++; |
| 432 |
this._hours -= 24; |
| 433 |
var mdays = this.getDaysInIslamicMonth(this._month, this._year); |
| 434 |
if(this._date > mdays){ |
| 435 |
this._month++; |
| 436 |
if(this._month >= 12){ this._year++; this._month -= 12; } |
| 437 |
this._date -= mdays; |
| 438 |
} |
| 439 |
} |
| 440 |
} |
| 441 |
} |
| 442 |
milliseconds -= 1000; |
| 443 |
} |
| 444 |
this._milliseconds = milliseconds; |
| 445 |
}, |
| 446 |
|
| 447 |
|
| 448 |
toString: function(){ |
| 449 |
|
| 450 |
|
| 451 |
|
| 452 |
|
| 453 |
|
| 454 |
|
| 455 |
|
| 456 |
var x = new Date(); |
| 457 |
x.setHours(this._hours); |
| 458 |
x.setMinutes(this._minutes); |
| 459 |
x.setSeconds(this._seconds); |
| 460 |
x.setMilliseconds(this._milliseconds); |
| 461 |
return this._month + " " + this._date + " " + this._year + " " + x.toTimeString(); |
| 462 |
}, |
| 463 |
|
| 464 |
|
| 465 |
toGregorian: function(){ |
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
|
| 470 |
|
| 471 |
|
| 472 |
var hYear = this._year; |
| 473 |
var hMonth = this._month; |
| 474 |
var hDate = this._date; |
| 475 |
var gdate = new Date(); |
| 476 |
var dayDiff = hDate - 1; |
| 477 |
var gregorianFirstRef = new Date(1882, 10, 12, this._hours, this._minutes, this._seconds, this._milliseconds); |
| 478 |
if(hYear >= this._hijriBegin && hYear <= this._hijriEnd){ |
| 479 |
for (var y = 0; y < hYear - this._hijriBegin; y++){ |
| 480 |
for(var m = 0; m < 12; m++){ |
| 481 |
dayDiff += parseInt(this._MONTH_LENGTH[y][m], 10) + 29; |
| 482 |
} |
| 483 |
} |
| 484 |
for(m = 0; m < hMonth; m++){ |
| 485 |
dayDiff += parseInt(this._MONTH_LENGTH[hYear - this._hijriBegin][m], 10) + 29; |
| 486 |
} |
| 487 |
gdate = dd.add(gregorianFirstRef, "day", dayDiff); |
| 488 |
|
| 489 |
} else{ |
| 490 |
var islamicDate = new dojox.date.islamic.Date(this._year, this._month, this._date, this._hours, this._minutes, this._seconds, this._milliseconds); |
| 491 |
gdate = new Date(islamicDate.toGregorian()); |
| 492 |
} |
| 493 |
return gdate; |
| 494 |
}, |
| 495 |
|
| 496 |
getDaysDiff: function (date1, date2) { |
| 497 |
|
| 498 |
|
| 499 |
var ONE_DAY = 1000 * 60 * 60 * 24; |
| 500 |
var diff = Math.abs(date1.getTime() - date2.getTime()); |
| 501 |
return Math.round(diff / ONE_DAY); |
| 502 |
}, |
| 503 |
|
| 504 |
|
| 505 |
fromGregorian: function( gdate){ |
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
var date = new Date(gdate); |
| 514 |
var gregorianFirstRef = new Date(1882, 10, 12, 0, 0, 0, 0); |
| 515 |
var gregorianLastRef = new Date(2174, 10, 25, 23, 59, 59, 999); |
| 516 |
var daysDiff = this.getDaysDiff(date, gregorianFirstRef); |
| 517 |
if (date - gregorianFirstRef >= 0 && date - gregorianLastRef <= 0) { |
| 518 |
var year = 1300; |
| 519 |
for (var i = 0; i < this._MONTH_LENGTH.length; i++, year++) { |
| 520 |
for (var j = 0; j < 12; j++) { |
| 521 |
var numOfDays = parseInt(this._MONTH_LENGTH[i][j], 10) + 29; |
| 522 |
if (daysDiff <= numOfDays) { |
| 523 |
this._date = daysDiff + 1; |
| 524 |
if (this._date > numOfDays) { |
| 525 |
this._date = 1; |
| 526 |
j++; |
| 527 |
} |
| 528 |
if (j > 11) { |
| 529 |
j = 0; |
| 530 |
year++; |
| 531 |
} |
| 532 |
this._month = j; |
| 533 |
this._year = year; |
| 534 |
this._hours = date.getHours(); |
| 535 |
this._minutes = date.getMinutes(); |
| 536 |
this._seconds = date.getSeconds(); |
| 537 |
this._milliseconds = date.getMilliseconds(); |
| 538 |
this._day = date.getDay(); |
| 539 |
return this; |
| 540 |
} |
| 541 |
daysDiff = parseInt(daysDiff, 10) - numOfDays; |
| 542 |
} |
| 543 |
} |
| 544 |
} else { |
| 545 |
var islamicDate = new dojox.date.islamic.Date(date); |
| 546 |
this._date = islamicDate.getDate(); |
| 547 |
this._month = islamicDate.getMonth(); |
| 548 |
this._year = islamicDate.getFullYear(); |
| 549 |
this._hours = gdate.getHours(); |
| 550 |
this._minutes = gdate.getMinutes(); |
| 551 |
this._seconds = gdate.getSeconds(); |
| 552 |
this._milliseconds = gdate.getMilliseconds(); |
| 553 |
this._day = gdate.getDay(); |
| 554 |
} |
| 555 |
return this; |
| 556 |
}, |
| 557 |
|
| 558 |
valueOf: function(){ |
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
|
| 563 |
return (this.toGregorian()).valueOf(); |
| 564 |
}, |
| 565 |
|
| 566 |
|
| 567 |
_yearStart: function(year){ |
| 568 |
|
| 569 |
|
| 570 |
return (year - 1) * 354 + Math.floor((3 + 11 * year) / 30.0); |
| 571 |
}, |
| 572 |
|
| 573 |
|
| 574 |
_monthStart: function(year, month){ |
| 575 |
|
| 576 |
|
| 577 |
return Math.ceil(29.5 * month) + |
| 578 |
(year - 1) * 354 + Math.floor((3 + 11 * year) / 30.0); |
| 579 |
}, |
| 580 |
|
| 581 |
|
| 582 |
_civilLeapYear: function(year){ |
| 583 |
|
| 584 |
|
| 585 |
return (14 + 11 * year) % 30 < 11; |
| 586 |
}, |
| 587 |
|
| 588 |
|
| 589 |
getDaysInIslamicMonth: function( month, year){ |
| 590 |
|
| 591 |
|
| 592 |
if(year >= this._hijriBegin && year <= this._hijriEnd){ |
| 593 |
var pos = year - this._hijriBegin; |
| 594 |
var length = 0; |
| 595 |
if(this._MONTH_LENGTH[pos].charAt(month) == 1) |
| 596 |
length = 30; |
| 597 |
else length = 29; |
| 598 |
}else{ |
| 599 |
var islamicDate = new dojox.date.islamic.Date(); |
| 600 |
length = islamicDate.getDaysInIslamicMonth(month, year); |
| 601 |
} |
| 602 |
return length; |
| 603 |
} |
| 604 |
}); |
| 605 |
|
| 606 |
|
| 607 |
IDate.getDaysInIslamicMonth = function(month){ |
| 608 |
return new IDate().getDaysInIslamicMonth(month.getMonth(),month.getFullYear()); |
| 609 |
}; |
| 610 |
|
| 611 |
return IDate; |
| 612 |
}); |
| 613 |
|