]> git.koha-community.org Git - koha.git/commit
Bug 35559: Correctly parse previous flatpickr date
authorEmily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Sun, 24 Mar 2024 20:07:16 +0000 (16:07 -0400)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 24 May 2024 12:43:23 +0000 (14:43 +0200)
commit8ff2b5b29ad6625f7014d0b4f6f225326fba078e
treeeb781a3873ddc0e52b2124f5c241400ec6b78087
parent04f722683929a9f18c5f5fd9706bf6d834779b54
Bug 35559: Correctly parse previous flatpickr date

The Flatpickr configuration for futuredate and futuredateinclusive is
meant to allow the preexisting date, even if it is in the past, to avoid
data loss. As of Bug 30718 - Use flatpickr's alt option everywhere,
that incoming date is in yyyy-mm-dd format, not the configured
human-readable format, and needs to be parsed accordingly.

To test:
1. Place 2 holds on the same bib, both with an expiration date set
2. Set the expiration date for one of the holds to a date in the past
   (e.g., in Koha Testing Docker, use the commands:
   ktd --shell
   koha-mysql kohadev
   to access the database directly)
3. Reload the holds tab for that bib
--> Note that the future expiration date will be editable, and the past
    expiration date will not be editable
4. In a new tab, go to Administration > Patron Categories
5. Edit one patron category to have an enrolment period date in the future
6. Edit another patron category to have an enrolment period date in the
   past (e.g. by accessing the database directly, as above)
7. Reload the Edit pages for each of the above categories (in new tabs)
--> Note that the future enrolment period date will be retained in the
    date field, but the past enrolment period date will be blanked out
8. Apply this patchset
9. Refresh the holds tab from step 3
--> Note that both expiration dates are now editable
10. Refresh the 2 patron category tabs from step 7
--> Note that both enrolment dates are now retained correctly
11. Open the date picker on one of the date fields that has a past date
--> Note that other past dates, besides the existing date, are prevented

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 54d884819121ecb18930bbf250dfbb21fc7ecb93)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc