New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for minyear and maxyear in the calendar.js #26119
Conversation
/media/system/js/fields/calendar.js at lines 861 and 864 call date.getOtherFullYear(this.params.dateType, year); But this function defined in /media/system/js/fields/calendar-locales/date/jalali/date-helper.js does not have a second parameter - year, so it can not be changed... Here's a fix for this issue... Fixes issue: joomla#19926
Have in mind that the minified version (media/system/js/fields/calendar.min.js - NOT PROVIDED) should be updated aswell |
@pinta83 please fill the Template (Summary of Changes |
@franz-wohlkoenig Done.. sry ;) |
Please use the following tool to compile/include the minified version. |
Updated version of the patched calendar.js
@Quy Done.. |
Fixed, tested and updated |
media/system/js/fields/calendar.js
Outdated
} else if (year > this.params.maxYear) { | ||
year = this.params.maxYear; | ||
date.getOtherFullYear(this.params.dateType, year); | ||
date.setOtherFullYear(this.params.dateType, year);; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a double semi-colon at the end of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
I have tested this item ✅ successfully on 922baab After having applied the patch e.g. with patchtester, you might have to clear your browser cache in order to use the changed js (or minified js if debug is switched off). This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26119. |
@dgrammatiko |
I have tested this item ✅ successfully on 922baab This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/26119. |
Status "Ready To Commit". |
Thanks for fixing the calendar. |
/media/system/js/fields/calendar.js at lines 861 and 864 call
date.getOtherFullYear(this.params.dateType, year);
But this function defined in
/media/system/js/fields/calendar-locales/date/jalali/date-helper.js
does not have a second parameter - year, so it can not be changed...
Here's a fix for this issue...
Pull Request for Issue #19926 .
Summary of Changes
Changes 2 lines of code so the picker would work as inteded
Testing Instructions
Create a datepicker input field with attribute maxyear set to -5
Expected result
When the field gets rendered the expected result of the initially displayed year - is the current year -5 years as defined.
Actual result
The year title is ok, but the calendar displayed does not reflect the shown year, but the current month is displayed. When you click the previous year button, you have to click 5 times until it gets to the right year, and then starts working as expected. It also lets you pick the date outside of range. This fixes all these issuse, as the wrong calendar month never gets displayed.
Documentation Changes Required
None