file : media/system/js/fields/calendar-locales/date/jalali/date-helper.js
Error : This function not return required data
Date.prototype.getLocalMonthDays = function(dateType, month) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
var year = this.getLocalFullYear('jalali');
if (typeof month == "undefined") {
month = this.getLocalMonth('jalali');
}
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
return 29;
} else {
Date.local_MD[month]; <=== Error : Must be returned this value
}
} else {
var year = this.getFullYear();
if (typeof month == "undefined") {
month = this.getMonth();
}
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
return 29;
} else {
return Date.gregorian_MD[month]; <==== Like this
}
}
};
This is Expected
Date.prototype.getLocalMonthDays = function(dateType, month) {
if (dateType != 'gregorian') {
/** Modify to match the current calendar when overriding **/
var year = this.getLocalFullYear('jalali');
if (typeof month == "undefined") {
month = this.getLocalMonth('jalali');
}
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
return 29;
} else {
return Date.local_MD[month];
}
} else {
var year = this.getFullYear();
if (typeof month == "undefined") {
month = this.getMonth();
}
if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
return 29;
} else {
return Date.gregorian_MD[month];
}
}
};
@balvard
Could you please add screenshots of the Jalali results obtained in both cases, i.e. with return and without the return, for a said Gregorian date?
@dgrammatiko
Any possible error here?
@balvard @infograf768 yes a return
is required as correctly stated above.
OK. You make patch or I do?
Priority | Critical | ⇒ | Medium |
(reset priority according to our defined criteria)
will do as we also need a minified, but testing now differences first.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-04-17 09:02:04 |
Closed_By | ⇒ | infograf768 |
And This function has same error
Date.prototype.getMonthDays
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28698.