-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
[Panel] Date field min/max settings not validated #1801
Comments
This is the original thread about the issue I face: https://forum.getkirby.com/t/how-to-use-min-max-for-date-fields/14376 Thanks for reporting this @texnixe! |
If I set |
✅ |
I downloaded v3.2.1-rc1 and used the above example and my origonal example. I'm still able to select invalid dates and to save them. Am I doing something wrong @bastianallgeier?
I tried US and German date format for min/max property. |
Hm, I can still enter wrong dates, but at least validation does now kick in when I select a wrong date. |
I get no validation at all @texnixe. Maybe it is related to the
|
Hm, even with that field, it works for me. Is your page a draft? Drafts are not validated. What happens, if you want to publish it? The thing is that it probably wouldn't make sense or wouldn't even be possible to limit the days and months shown in a way that would completely make it impossible to select a wrong date - depending on what date ranges you have selected. Let's say you have a date range from 01.01.2015 to 25.06.2017, in that case, you would have to show all days and months. Still, selecting a wrong date like 30.08.2017 would be possible, so validating the date is the only way. To help the user choosing a correct data, some help text under the field would be useful though. |
True, I forgot that validation happens on publishing level, not on draft level, although it happens with You are right about showing all days and months in specific situations. But in some cases we could limit it or at least limit the javascript datepicker. I think that would be a cheap but good improvement. |
Describe the bug
When setting up a date field with min and max values the settings are not validated.
While the dropdown limits the years to choose from (only if
time: true
is not set), this is not true for the months and days. Also, you can still pick any date using the date picker. What is more, you cannot only pick a date outside this range, you can also save this date without validation kicking in.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Dates outside the range should not be pickable nor should they validate.
Screenshots
Kirby Version
3.1.4 and feature branch
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: