Bugzilla – Attachment 184411 Details for
Bug 36136
Flatpickr allows selecting date from the past on copied serial subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36136: Make sure 'to' dates are instantiated with the 'from' dates as minimum
Bug-36136-Make-sure-to-dates-are-instantiated-with.patch (text/plain), 1.90 KB, created by
Owen Leonard
on 2025-07-18 18:07:09 UTC
(
hide
)
Description:
Bug 36136: Make sure 'to' dates are instantiated with the 'from' dates as minimum
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-07-18 18:07:09 UTC
Size:
1.90 KB
patch
obsolete
>From e3edb4ed7fd9f2222455bfa18d5da64e0ef29f95 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 18 Jul 2025 15:14:12 +0200 >Subject: [PATCH] Bug 36136: Make sure 'to' dates are instantiated with the > 'from' dates as minimum > >To test you should check the behavior of forms which have sets of "from" >and "to" dates. It shouldn't be possible to select a "to" date which is >before the "from" date. For example: > >- Overdues report >- Invoice search > >In some cases we need to check that the fields work correctly when the >"from" date is already filled: > >- Editing vendor issues >- Editing a budget >- Duplicating a subscription > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc | 11 +++++++++++ > 1 file changed, 11 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >index 681e8cc4013..a5962de0265 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc >@@ -114,6 +114,17 @@ > } > } > new Maskito( instance.altInput, maskitoOptions ); >+ >+ /* If there is a node with data-date_to with the id of this node it means we are instantiating a 'from' for a date range */ >+ const toInput = instance.input; >+ const fromInput = document.querySelector(`[data-date_to='${toInput.id}']`); >+ if (fromInput && fromInput._flatpickr) { >+ const fromDate = fromInput._flatpickr.selectedDates[0]; >+ if (fromDate) { >+ instance.set('minDate', fromDate); >+ } >+ } >+ > }, > onChange: function( selectedDates, dateText, instance) { > if (selectedDates.length === 0) { >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36136
:
183724
|
184377
| 184411