Bug 36738: Don't copy date when repeating date fields

Make the repeatable date patron attribute empty when repeating the
inputs to avoid date formatting problems (and keeping past date value
after repeating is not something we want)

Test plan:
1- create a patron attribute type with is a date and repeatable checked
(administration -> patron attribute types)
2- add a couple of patron attribute of type date, notice the repeated
inputs contain previous data
3- Apply the patch
4- redo step 2 and notice the repeated inputs are empty

Follow up for bug 32610 (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32610)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Shi Yao Wang 2024-04-30 15:02:50 -04:00 committed by Katrin Fischer
parent 834fc10650
commit ce4ab12a3c
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 0 additions and 2 deletions

View File

@ -60,11 +60,9 @@ function clone_entry(node) {
// regenerate flatpickr calendars to add event listeners
$(`.flatpickr_wrapper`, clone).remove();
var date = $("> .flatpickr", original).val();
$(".flatpickr", clone).each(function(){
apply_flatpickr(this);
});
$(`.flatpickr_wrapper .flatpickr, #patron_attr_${newId}.flatpickr`, clone).val(date);
return false;
}