//>>built
define("dojox/date/hebrew",["..","dojo/_base/lang","dojo/date","./hebrew/Date"],function(j,k,l,i){var g=k.getObject("date.hebrew",!0,j);g.getDaysInMonth=function(b){return b.getDaysInHebrewMonth(b.getMonth(),b.getFullYear())};g.compare=function(b,c,a){b instanceof i&&(b=b.toGregorian());c instanceof i&&(c=c.toGregorian());return l.compare.apply(null,arguments)};g.add=function(b,c,a){var e=new i(b);switch(c){case "day":e.setDate(b.getDate()+a);break;case "weekday":var c=b.getDay(),d=0;0>a&&6==c&&(c=
5,d=-1);if(5>c+a&&0<=c+a)e.setDate(b.getDate()+a+d);else{var f=0<a?5:-1,h=0<a?2:-2;if(0<a&&(5==c||6==c))d=4-c,c=4;var a=c+a-f,g=parseInt(a/5);e.setDate(b.getDate()-c+h+7*g+d+a%5+f)}break;case "year":e.setFullYear(b.getFullYear()+a);break;case "week":e.setDate(b.getDate()+7*a);break;case "month":c=b.getMonth();a=c+a;b.isLeapYear(b.getFullYear())||(5>c&&5<=a?a++:5<c&&5>=a&&a--);e.setMonth(a);break;case "hour":e.setHours(b.getHours()+a);break;case "minute":e._addMinutes(a);break;case "second":e._addSeconds(a);
break;case "millisecond":e._addMilliseconds(a)}return e};g.difference=function(b,c,a){var c=c||new i,a=a||"day",e=c.getFullYear()-b.getFullYear(),d=1;switch(a){case "weekday":d=Math.round(g.difference(b,c,"day"));a=parseInt(g.difference(b,c,"week"));if(0==d%7)d=5*a;else{var e=0,f=b.getDay(),h=c.getDay(),a=parseInt(d/7),c=d%7,b=new i(b);b.setDate(b.getDate()+7*a);b=b.getDay();if(0<d)switch(!0){case 5==f:e=-1;break;case 6==f:e=0;break;case 5==h:e=-1;break;case 6==h:e=-2;break;case 5<b+c:e=-2}else if(0>
d)switch(!0){case 5==f:e=0;break;case 6==f:e=1;break;case 5==h:e=2;break;case 6==h:e=1;break;case 0>b+c:e=2}d=d+e-2*a}break;case "year":d=e;break;case "month":f=c.toGregorian()>b.toGregorian()?c:b;a=c.toGregorian()>b.toGregorian()?b:c;h=f.getMonth();d=a.getMonth();if(0==e)d=!c.isLeapYear(c.getFullYear())&&5<f.getMonth()&&5>=a.getMonth()?f.getMonth()-a.getMonth()-1:f.getMonth()-a.getMonth();else{d=!a.isLeapYear(a.getFullYear())&&6>d?13-d-1:13-d;d+=!f.isLeapYear(f.getFullYear())&&5<h?h-1:h;e=a.getFullYear()+
1;for(f=f.getFullYear();e<f;e++)d+=a.isLeapYear(e)?13:12}c.toGregorian()<b.toGregorian()&&(d=-d);break;case "week":d=parseInt(g.difference(b,c,"day")/7);break;case "day":d/=24;case "hour":d/=60;case "minute":d/=60;case "second":d/=1E3;case "millisecond":d*=c.toGregorian().getTime()-b.toGregorian().getTime()}return Math.round(d)};return g});