?
avatar balvard
balvard
17 Apr 2020

Steps to reproduce the issue

file : media/system/js/fields/calendar-locales/date/jalali/date-helper.js
Error : This function not return requiredscreen shot 2020-04-17 at 08 00 42 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
		}
	}
};

Expected result

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];
		}
	}
};

Actual result

System information (as much as possible)

Additional comments

avatar balvard balvard - open - 17 Apr 2020
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Apr 2020
avatar balvard
balvard - comment - 17 Apr 2020

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.

avatar infograf768
infograf768 - comment - 17 Apr 2020

@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?

avatar infograf768 infograf768 - change - 17 Apr 2020
The description was changed
avatar infograf768 infograf768 - edited - 17 Apr 2020
avatar dgrammatiko
dgrammatiko - comment - 17 Apr 2020

@balvard @infograf768 yes a return is required as correctly stated above.

avatar infograf768
infograf768 - comment - 17 Apr 2020

OK. You make patch or I do?

avatar brianteeman brianteeman - change - 17 Apr 2020
Priority Critical Medium
avatar brianteeman
brianteeman - comment - 17 Apr 2020

(reset priority according to our defined criteria)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28698.

avatar dgrammatiko
dgrammatiko - comment - 17 Apr 2020

You make patch or I do?

If you're referring to me please do the PR (or maybe @balvard would like to do that)

avatar infograf768
infograf768 - comment - 17 Apr 2020

will do as we also need a minified, but testing now differences first.

avatar infograf768
infograf768 - comment - 17 Apr 2020

Please see patch #28700

@balvard
Please explain there the display differences with screenshots.
Closing this as we have a patch.

avatar infograf768 infograf768 - change - 17 Apr 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-04-17 09:02:04
Closed_By infograf768
avatar infograf768 infograf768 - close - 17 Apr 2020

Add a Comment

Login with GitHub to post a comment