Bug 29241: Allow display of past date for .futuredate
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 14 Oct 2021 09:36:02 +0000 (11:36 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 25 Oct 2021 11:56:30 +0000 (13:56 +0200)
commit44ddbf8ec781a08206e43b7202b7c779db310725
tree7f213477dbdf17238715b83040ca244c92af006c
parente203730002d88caba5bf5100a4ed662f6c521ad5
Bug 29241: Allow display of past date for .futuredate

When a past date is set for a flatpickr instance with the .futuredate
class, only dates in the future are available AND the input is blanked.
It does not display the date in the past.

For instance if a hold is expired (expirationdate in the past), the date input will be blanked.

We can use the flatpickr's allowInvalidPreload option to allow date in the past to be displayed.

Test plan:
Place a hold
Edit its expirationdate and set a date in the past (yesterday is fine)
Go to /reserve/request.pl?biblionumbers=42
=> With the patch you see the date, and the widget let you chose anoter date,
in the future
=> Without this patch the expiration date is not displayed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc