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
Calendar field bug with param maxyear #19926
Comments
The data-attributs in the html-Code are ok. the bug must bee in the calendar.js This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19926. |
is max year bigger than min year? |
minyear is not specified because i don't need a min year, only a max year older then the current. In the joomla documentation it is a optional value. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19926. |
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19926. |
name="birthday" This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19926. |
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19926. |
More info required? Which? Could someone reproduce the bug? This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19926. |
I can reproduce this |
I have the same issue.... My maxdate is set to "-7", and when i click the date picker it only shows the currentyear -7 in the header... The actuall caledar is rendered for the current month, and I have to click the left nav arrow 7 time before i even get to the year, and then it finaly starts to change. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19926. |
And to go even further... I can click the dates (in current month) and the date will be set regardless of maxyear being set This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19926. |
Found and solved the problem.... If you take a look at /media/system/js/fields/calendar.js at lines 863-869 you can see the date.getOtherFullYear(this.params.dateType, year) call with a second parameter being a year. Now if you take a look at the getOtherFullYear() function defined in /media/system/js/fields/calendar-locales/date/jalali/date-helper.js you will see that the function excepts only 1 paramterer... /** Returns the year for the current date. / Fix
The bugfix covers minyear bug aswell, since both are handled on the same place.. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19926. |
@dgrammatiko comment as js-guru? |
Seems reasonable |
@pinta83 can you do a Pull Request? |
Will do it today if I catch the time, if not - tommorow morrning ;) |
/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
Closed as having Pull Request #26119 |
/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: #19926
Steps to reproduce the issue
Add a calendar field to a form with param maxyear="-18" to set the highest year in caleandar to year 2000
In Browser click on the calendat button to choose a day
Expected result
If i click on a day in the calendar, the selected date should shown in the input field.
Actual result
After selected a date, year 2000 is shown, you get a date with current year.
Try to choose a date in year 1999. Year 2000 is shown but you hav to cklick 19 times to set the year to 1999.
The Callendar JS seems to work not with the year given by "current year" and maxyear. It works calculates only with "current year".
System information (as much as possible)
Joomla 3.8.6
The text was updated successfully, but these errors were encountered: