Before the introduction of Flatpickr, when adding a new item if you clicked on the date acquired field, and it was empty, it would be prefilled with today's date. It would be useful if we could get that functionality back.
I am seeing this in 21.11 too. Note that it is about focus of the text box. Clicking on the plugin control next to the text box does still update the field.
When you focus the field, the date popup comes up. If that would respond to Enter, it would already be helpful?
How to categorize this bug might be hard too: If lots of items would not get a date anymore, a library might not consider this Minor anymore
(In reply to Marcel de Rooy from comment #3) > How to categorize this bug might be hard too: If lots of items would not get > a date anymore, a library might not consider this Minor anymore Today's date is used autommagically when you leave the input empty. So that won't be the case, but I also liked the old behaviour as it allowed easy manipulation of the date.
(In reply to Katrin Fischer from comment #4) > (In reply to Marcel de Rooy from comment #3) > > How to categorize this bug might be hard too: If lots of items would not get > > a date anymore, a library might not consider this Minor anymore > > Today's date is used autommagically when you leave the input empty. So that > won't be the case, but I also liked the old behaviour as it allowed easy > manipulation of the date. That is depending on the context. You are right for new items. Which will be the scope mainly here. For existing items, see bug 29958: Do not set dateaccessioned on updates
Could this be related to Bug 30797 ?
Looking back at 21.05.x I see that this works with via the dateaccessioned.pl plugin. In the dateaccessioned.pl code there is this event handler: function Focus$function_name(event) { set_to_today(event.data.id); } Looking at master now I see that the event handler is still there on the 'tag_952_subfield_d_' element but has an input type of 'type="hidden"'. That is being hidden by flatpickr, so the event needs to be attached to the Flatpickr wrapper.
Created attachment 145923 [details] [review] Bug 31665: Set today date for date cataloguing plugin dateaccessioned.pl must pick today's date when the input gets the focus on. Test plan: Edit an item, or create a new one. Confirm that today's date is prefilled into the date's input when it's empty and that it gets the focus on
I am really hesitant here, didn't we decide to not prefill it? See bug 29963.
(In reply to Jonathan Druart from comment #9) > I am really hesitant here, didn't we decide to not prefill it? > > See bug 29963. Ok, got it. This is about the focus. Then I think the patch is correct.
Created attachment 145979 [details] [review] Bug 31665: Set today date for date cataloguing plugin dateaccessioned.pl must pick today's date when the input gets the focus on. Test plan: Edit an item, or create a new one. Confirm that today's date is prefilled into the date's input when it's empty and that it gets the focus on Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Created attachment 145981 [details] [review] Bug 31665: Set today date for date cataloguing plugin dateaccessioned.pl must pick today's date when the input gets the focus on. Test plan: Edit an item, or create a new one. Confirm that today's date is prefilled into the date's input when it's empty and that it gets the focus on Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Michael Adamyk <madamyk@ckls.org>
Created attachment 147721 [details] [review] Bug 31665: Set today date for date cataloguing plugin dateaccessioned.pl must pick today's date when the input gets the focus on. Test plan: Edit an item, or create a new one. Confirm that today's date is prefilled into the date's input when it's empty and that it gets the focus on Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Michael Adamyk <madamyk@ckls.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work, thanks everyone! Pushed to 22.11.x for the next release.
Won't apply cleanly to 22.05, no backport