Bug 30717: Format dates when editing items
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 9 May 2022 08:28:51 +0000 (10:28 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Sat, 14 May 2022 01:41:55 +0000 (15:41 -1000)
commita3870cc25b40379e0f538c3b3c08fb8fe3540a8e
tree528a99fce6b521df27541ead18e9d33bd1b58469
parent656e864e6b3234a5d493bd2b44bc3b831bd458f1
Bug 30717: Format dates when editing items

This is a result of bug 29369 and bug 27526.
Bug 29369 removed the format of the dates, and bug 27526 assumed that it
was the correct behaviour.

Here we don't want to let the controller know which fields is a date, or
we will have to access the subfield structure to know which subfields
have the "date cataloguing plugin".

This patch suggests to use the altFormat options from flatpickr that
will "Show the user a readable date (as per altFormat), but return
something totally different to the server."

It's actually an option we want to use for all our dates, that will
reduce a lot the overhead in our controllers.

Test plan:
Edit items (additem.pl and in batch) and confirm that the subfields
using the dateaccessioned plugin are displayed according to the
dateformat syspref. Make sure the date is stored correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
cataloguing/value_builder/dateaccessioned.pl