In the patron entry form, the calendar widget lets the user pick dates in the future. It should require dates in the past.
Created attachment 134753 [details] [review] Bug 30713: Patron entry should limit date of birth selection to dates in the past This patch adds to the configuration of the date of birth field in the patron entry form so that the calendar widget prohibits the selection of a date in the future. To test, apply the patch and open a patron record for editing. Try to select a birth date in the future using the calendar widget. You should be limited to a selection of yesterday or before.
Hi Owen. This does change the calendar widget, but clicking on 'Yesterday' clears an existing date in the input field and doesn't put yesterday's date in for both an existing patron and a new patron (tried in both Firefox Developer Edition and Google Chrome). I can select the date from the date picker, and future dates are not shown. I'm hoping this is something to do with the timezone set for koha-testing-docker and my desktop. David
I used a sandbox and get the same result as David.
Created attachment 134816 [details] [review] Bug 30713: Patron entry should limit date of birth selection to dates in the past This patch adds to the configuration of the date of birth field in the patron entry form so that the calendar widget prohibits the selection of a date in the future. To test, apply the patch and open a patron record for editing. Try to select a birth date in the future using the calendar widget. You should be limited to a selection of today or before. Confirm that clicking the "Yesterday" and "Today" shortcuts in the calendar widget works correctly.
> This does change the calendar widget, but clicking on 'Yesterday' clears an > existing date in the input field and doesn't put yesterday's date Further investigation shows that this is a bug in our Flatpickr implementation, not with the change I've made to this particular template. See the "Patrons with no checkouts" report (/cgi-bin/koha/reports/borrowers_out.pl) which has a similarly-configured date picker. While debugging this I did see that I'd missed one of the options Jonathan implemented in Flatpickr: a "pastinclusive" option which limits to dates in the past OR today. This is both more correct for this situation and working correctly, so I have resubmitted with this change.
Created attachment 134836 [details] [review] Bug 30713: Patron entry should limit date of birth selection to dates in the past This patch adds to the configuration of the date of birth field in the patron entry form so that the calendar widget prohibits the selection of a date in the future. To test, apply the patch and open a patron record for editing. Try to select a birth date in the future using the calendar widget. You should be limited to a selection of today or before. Confirm that clicking the "Yesterday" and "Today" shortcuts in the calendar widget works correctly. Signed-off-by: David Nind <david@davidnind.com>
Thanks Owen for fixing - I wasn't sure I had originally tested it correctly (thanks also Sally for testing and confirming as well!).
Created attachment 134950 [details] [review] Bug 30713: Patron entry should limit date of birth selection to dates in the past This patch adds to the configuration of the date of birth field in the patron entry form so that the calendar widget prohibits the selection of a date in the future. To test, apply the patch and open a patron record for editing. Try to select a birth date in the future using the calendar widget. You should be limited to a selection of today or before. Confirm that clicking the "Yesterday" and "Today" shortcuts in the calendar widget works correctly. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Pushed to master for 22.11. Nice work everyone, thanks!
Backported to 22.05.x for 22.05.03