-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 form field maxyear/minyear 0 does not limit to this year #19831
Comments
I'm afraid that's not the way this works. So the min and max are set by the current language. If you set the attributes these need to be either an negative, zero or a positive number, which are related to the current year (eg min="-10" means that the calendar will not allow years before (2018-10 =) 2008. |
@dgt41 You haven't understood at all. By setting min or max to zero the user should not be able to select anything but the current year, they should ONLY be allowed to select this current year. However, if you set min and max to zero they can freely select any year. How do you limit the date picker to only allow current year? I do NOT want free selecting year but only the current year. Do you understand now what I am trying to do? |
@dgt41 then the documentation is not correct?
|
To only be allowed to select a date from the current year, both the |
@C-Lodder That is wrong. If both are set to -1 user is only allowed to select a date from the previous year. E.g. if set both to -1 only dates in 2017 are allowed. Also that is not what the documentation says. So both the documentation is wrong and the calendar doesn't work as expected. The documentation states that both should be set to 0 to limit to current year. That does't work. There is no way to limit user to current year. |
Ah crap, my bad. Still think we're in 2017 for some reason. |
I don't think that I wrote something different in my comment. The only thing I added was that by default the min/max are set on the current language (about 100 years rang if I remember correctly) |
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/19831 |
See PR #19846 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19831. |
Steps to reproduce the issue
In form xml use
<field class="inputbox" description="Date" filltable="false" filter="server_utc" hint="Select a date" label="Date" name="date" showtime="false" singleheader="false" minyear="0" maxyear="0" timeformat="12" todaybutton="false" type="calendar" weeknumbers="false" />
Expected result
User should not be able to select a date from a year higher or lower than current year but should be able to select a date from the current year only.
Actual result
User can freely select any date
System information (as much as possible)
Additional comments
Using -1 and 1 respectively allows a user to only select from one year previous or next current year. Logic dictates that 0 should not allow the user to select previous or next but only a date from the current year.
The text was updated successfully, but these errors were encountered: