CoreFiles by mySites.guru
date-helper.min.js2 lines, 9,192 bytes, from Joomla_5.4.9-Stable-Full_Package.zip
Raw History Compare with 5.4.8
md5
6bc593b32c01d50c357dec6ff630cf89
sha1
e47fd637730347117f172990741b5f8de52c79d6
sha256
e7474b688fb459530e626bafc7f81a95ca26db4a44a2e73145b74fc1c13a87c8
(function(a){"use strict";var w=["\u06F0","\u06F1","\u06F2","\u06F3","\u06F4","\u06F5","\u06F6","\u06F7","\u06F8","\u06F9"];a.gregorian_MD=[31,28,31,30,31,30,31,31,30,31,30,31],a.local_MD=[31,31,31,31,31,31,30,30,30,30,30,29],a.SECOND=1e3,a.MINUTE=60*a.SECOND,a.HOUR=60*a.MINUTE,a.DAY=24*a.HOUR,a.WEEK=7*a.DAY,a.prototype.setLocalDateOnly=function(e,t){if(e!="gregorian")return"";var r=new a(t);this.setDate(1),this.setFullYear(r.getFullYear()),this.setMonth(r.getMonth()),this.setDate(r.getDate())},a.prototype.setLocalDate=function(e,t){return e!="gregorian"?this.setJalaliDate(t):this.setDate(t)},a.prototype.setLocalMonth=function(e,t,r){return e!="gregorian"?this.setJalaliMonth(t,r):(r==null&&this.getDate(),this.setMonth(t))},a.prototype.setOtherFullYear=function(e,t){if(e!="gregorian"){var r=new a(this);return r.setLocalFullYear(t),r.getLocalMonth("jalali")!=this.getLocalMonth("jalali")&&this.setLocalDate("jalali",29),this.setLocalFullYear("jalali",t)}else{var r=new a(this);return r.setFullYear(t),r.getMonth()!=this.getMonth()&&this.setDate(28),this.setUTCFullYear(t)}},a.prototype.setLocalFullYear=function(e,t){if(e!="gregorian")return this.setJalaliFullYear(t);var r=new a(this);return r.setFullYear(t),r.getMonth()!=this.getMonth()&&this.setDate(28),this.setFullYear(t)},a.prototype.getLocalWeekDays=function(e,t){return e!="gregorian",6},a.prototype.getOtherFullYear=function(e){return e!="gregorian"?this.getJalaliFullYear():this.getFullYear()},a.prototype.getLocalFullYear=function(e){return e!="gregorian"?this.getJalaliFullYear():this.getFullYear()},a.prototype.getLocalMonth=function(e){return e!="gregorian"?this.getJalaliMonth():this.getMonth()},a.prototype.getLocalDate=function(e){return e!="gregorian"?this.getJalaliDate():this.getDate()},a.prototype.getLocalDay=function(e){return e!="gregorian"?this.getJalaliDay():this.getDay()},a.prototype.getLocalMonthDays=function(e,t){if(e!="gregorian"){var r=this.getLocalFullYear("jalali");return typeof t>"u"&&(t=this.getLocalMonth("jalali")),r%4==0&&(r%100!=0||r%400==0)&&t==1?29:a.local_MD[t]}else{var r=this.getFullYear();return typeof t>"u"&&(t=this.getMonth()),r%4==0&&(r%100!=0||r%400==0)&&t==1?29:a.gregorian_MD[t]}},a.prototype.getLocalWeekNumber=function(e){if(e!="gregorian"){var t=new a(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),r=t.getDay();t.setDate(t.getDate()-(r+6)%7+3);var l=t.valueOf();return t.setMonth(0),t.setDate(4),Math.round((l-t.valueOf())/(7*864e5))+1}else{var t=new a(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),r=t.getDay();t.setDate(t.getDate()-(r+6)%7+3);var l=t.valueOf();return t.setMonth(0),t.setDate(4),Math.round((l-t.valueOf())/(7*864e5))+1}},a.prototype.getLocalDayOfYear=function(e){if(e!="gregorian"){var t=new a(this.getOtherFullYear(e),this.getLocalMonth(e),this.getLocalDate(e),0,0,0),r=new a(this.getOtherFullYear(e),0,0,0,0,0),l=t-r;return Math.floor(l/a.DAY)}else{var t=new a(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0),r=new a(this.getFullYear(),0,0,0,0,0),l=t-r;return Math.floor(l/a.DAY)}},a.prototype.getMonthDays=function(e){var t=this.getFullYear();return typeof e>"u"&&(e=this.getMonth()),t%4==0&&(t%100!=0||t%400==0)&&e==1?29:a.dateType!="gregorian"?a.local_MD[e]:a.gregorian_MD[e]},a.prototype.equalsTo=function(e){return this.getFullYear()==e.getFullYear()&&this.getMonth()==e.getMonth()&&this.getDate()==e.getDate()&&this.getHours()==e.getHours()&&this.getMinutes()==e.getMinutes()},a.localCalToGregorian=function(e,t,r){return h.jalaliToGregorian(e,t,r)},a.gregorianToLocalCal=function(e,t,r){return h.gregorianToJalali(e,t,r)},a.numbersToIso=function(e){var t,r=[0,1,2,3,4,5,6,7,8,9];for(e=e.toString(),t=0;t<r.length;t++)e=e.replace(new RegExp(w[t],"g"),r[t]);return e},a.convertNumbers=function(e){e=e.toString();for(var t=0,r=w.length;t<r;t++)e=e.replace(new RegExp(t,"g"),w[t]);return e},a.toEnglish=function(e){e=this.toString();for(var t=[0,1,2,3,4,5,6,7,8,9],r=0;r<10;r++)e=e.replace(new RegExp(t[r],"g"),r);return e},a.monthsToLocalOrder=function(e,t){return t==="jalali"&&(e.push(e.shift()),e.push(e.shift())),e},a.prototype.print=function(e,t,r,l){if(typeof t!="string"&&(e=""),t||(t="gregorian"),typeof e!="string"&&(e=""),!e||this.getLocalDate(t)=="NaN"||!this.getLocalDate(t))return"";var f=this.getLocalMonth(t),g=this.getLocalDate(t),s=this.getLocalFullYear(t),o=this.getLocalWeekNumber(t),i=this.getLocalDay(t),n={},c=this.getHours(),u=c>=12,v=u?c-12:c,p=this.getLocalDayOfYear(t);v==0&&(v=12);var M=this.getMinutes(),L=this.getSeconds();n["%a"]=l.shortDays[i],n["%A"]=l.days[i],n["%b"]=l.shortMonths[f],n["%B"]=l.months[f],n["%C"]=1+Math.floor(s/100),n["%d"]=g<10?"0"+g:g,n["%e"]=g,n["%H"]=c<10?"0"+c:c,n["%I"]=v<10?"0"+v:v,n["%j"]=p<100?p<10?"00"+p:"0"+p:p,n["%k"]=c,n["%l"]=v,n["%m"]=f<9?"0"+(1+f):1+f,n["%M"]=M<10?"0"+M:M,n["%n"]=`
`,n["%p"]=u?l.pm.toUpperCase():l.am.toUpperCase(),n["%P"]=u?l.pm:l.am,n["%s"]=Math.floor(this.getTime()/1e3),n["%S"]=L<10?"0"+L:L,n["%t"]="	",n["%U"]=n["%W"]=n["%V"]=o<10?"0"+o:o,n["%u"]=i+1,n["%w"]=i,n["%y"]=(""+s).substring(2),n["%Y"]=s,n["%%"]="%";var F=/%./g,y=e.replace(F,function(Y){return n[Y]||Y});return r&&(y=a.convertNumbers(y)),y},a.parseFieldDate=function(e,t,r,l,f){e=a.numbersToIso(e);var g=new a,s=0,o=-1,i=0,n=e.split(/\W+/),c=t.match(/%./g),u=0,v=0,p=0,M=0,L=0;for(u=0;u<n.length;++u)if(n[u])switch(c[u]){case"%d":case"%e":i=parseInt(n[u],10);break;case"%m":o=parseInt(n[u],10)-1;break;case"%Y":case"%y":s=parseInt(n[u],10),s<100&&(s+=s>29?1900:2e3);break;case"%b":case"%B":for(v=0;v<12;++v)if(l.months[v].substring(0,n[u].length).toLowerCase()===n[u].toLowerCase()){o=v;break}break;case"%H":case"%I":case"%k":case"%l":p=parseInt(n[u],10);break;case"%P":case"%p":/pm/i.test(n[u])&&p<12?p+=12:/am/i.test(n[u])&&p>=12&&(p-=12);break;case"%M":M=parseInt(n[u],10);break;case"%S":L=parseInt(n[u],10);break}if(isNaN(s)&&(s=g.getFullYear()),isNaN(o)&&(o=g.getMonth()),isNaN(i)&&(i=g.getDate()),isNaN(p)&&(p=g.getHours()),isNaN(M)&&(M=g.getMinutes()),s!=0&&o!=-1&&i!=0){var F=new a(s,o,i,p,M,0);return F.rawYear=s,F.rawMonth=o,F.rawDay=i,F}if(f)return null;for(s=0,o=-1,i=0,u=0;u<n.length;++u)if(n[u].search(/[a-zA-Z]+/)!=-1){var y=-1;for(v=0;v<12;++v)if(l.months[v].substring(0,n[u].length).toLowerCase()===n[u].toLowerCase()){y=v;break}y!=-1&&(o!=-1&&(i=o+1),o=y)}else parseInt(n[u],10)<=12&&o==-1?o=n[u]-1:parseInt(n[u],10)>31&&s==0?(s=parseInt(n[u],10),s<100&&(s+=s>29?1900:2e3)):i==0&&(i=n[u]);if(s==0&&(s=g.getFullYear()),o!=-1&&i!=0){var Y=new a(s,o,i,p,M,0);return Y.rawYear=s,Y.rawMonth=o,Y.rawDay=i,Y}return g.rawYear=g.getFullYear(),g.rawMonth=g.getMonth(),g.rawDay=g.getDate(),g};var h={g_days_in_month:[31,28,31,30,31,30,31,31,30,31,30,31],j_days_in_month:[31,31,31,31,31,31,30,30,30,30,30,29]};h.jalaliToGregorian=function(e,t,r){e=parseInt(e),t=parseInt(t),r=parseInt(r);for(var l=e-979,f=t-1,g=r-1,s=365*l+parseInt(l/33)*8+parseInt((l%33+3)/4),o=0;o<f;++o)s+=h.j_days_in_month[o];s+=g;var i=s+79,n=1600+400*parseInt(i/146097);i=i%146097;var c=!0;i>=36525&&(i--,n+=100*parseInt(i/36524),i=i%36524,i>=365?i++:c=!1),n+=4*parseInt(i/1461),i%=1461,i>=366&&(c=!1,i--,n+=parseInt(i/365),i=i%365);for(var o=0;i>=h.g_days_in_month[o]+(o==1&&c);o++)i-=h.g_days_in_month[o]+(o==1&&c);var u=o+1,v=i+1;return[n,u,v]},h.checkDate=function(e,t,r){return!(e<0||e>32767||t<1||t>12||r<1||r>h.j_days_in_month[t-1]+(t==12&&!((e-979)%33%4)))},h.gregorianToJalali=function(e,t,r){e=parseInt(e),t=parseInt(t),r=parseInt(r);for(var l=e-1600,f=t-1,g=r-1,s=365*l+parseInt((l+3)/4)-parseInt((l+99)/100)+parseInt((l+399)/400),o=0;o<f;++o)s+=h.g_days_in_month[o];f>1&&(l%4==0&&l%100!=0||l%400==0)&&++s,s+=g;var i=s-79,n=parseInt(i/12053);i%=12053;var c=979+33*n+4*parseInt(i/1461);i%=1461,i>=366&&(c+=parseInt((i-1)/365),i=(i-1)%365);for(var o=0;o<11&&i>=h.j_days_in_month[o];++o)i-=h.j_days_in_month[o];var u=o+1,v=i+1;return[c,u,v]},a.prototype.setJalaliFullYear=function(e,t,r){var l=this.getDate(),f=this.getMonth(),g=this.getFullYear(),s=h.gregorianToJalali(g,f+1,l);e<100&&(e+=1300),s[0]=e,t!=null&&(t>11&&(s[0]+=Math.floor(t/12),t=t%12),s[1]=t+1),r!=null&&(s[2]=r);var o=h.jalaliToGregorian(s[0],s[1],s[2]);return this.setFullYear(o[0],o[1]-1,o[2])},a.prototype.setJalaliMonth=function(e,t){var r=this.getDate(),l=this.getMonth(),f=this.getFullYear(),g=h.gregorianToJalali(f,l+1,r);e>11&&(g[0]+=Math.floor(e/12),e=e%12),g[1]=e+1,t!=null&&(g[2]=t);var s=h.jalaliToGregorian(g[0],g[1],g[2]);return this.setFullYear(s[0],s[1]-1,s[2])},a.prototype.setJalaliDate=function(e){var t=this.getDate(),r=this.getMonth(),l=this.getFullYear(),f=h.gregorianToJalali(l,r+1,t);f[2]=e;var g=h.jalaliToGregorian(f[0],f[1],f[2]);return this.setFullYear(g[0],g[1]-1,g[2])},a.prototype.getJalaliFullYear=function(){var e=this.getDate(),t=this.getMonth(),r=this.getFullYear(),l=h.gregorianToJalali(r,t+1,e);return l[0]},a.prototype.getJalaliMonth=function(){var e=this.getDate(),t=this.getMonth(),r=this.getFullYear(),l=h.gregorianToJalali(r,t+1,e);return l[1]-1},a.prototype.getJalaliDate=function(){var e=this.getDate(),t=this.getMonth(),r=this.getFullYear(),l=h.gregorianToJalali(r,t+1,e);return l[2]},a.prototype.getJalaliDay=function(){var e=this.getDay();return e=e%7,e}})(Date);

The same content is in 24 releases, Joomla 5.4.8-rc1 to 6.3.0-alpha1. See them all, or every version of this file.