Bugzilla – Attachment 126825 Details for
Bug 29212
Use Flatpickr on OPAC pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29212: (follow-up) Incorporate linked date field code from Bug 29240
Bug-29212-follow-up-Incorporate-linked-date-field-.patch (text/plain), 5.01 KB, created by
David Nind
on 2021-10-25 12:47:14 UTC
(
hide
)
Description:
Bug 29212: (follow-up) Incorporate linked date field code from Bug 29240
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-10-25 12:47:14 UTC
Size:
5.01 KB
patch
obsolete
>From a0e31ffd6c17fd02ead5922f51b31eaed185df2c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 14 Oct 2021 15:57:20 +0000 >Subject: [PATCH] Bug 29212: (follow-up) Incorporate linked date field code > from Bug 29240 > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../bootstrap/en/includes/calendar.inc | 20 +++++------------ > .../bootstrap/en/modules/opac-reserve.tt | 22 ++----------------- > 2 files changed, 8 insertions(+), 34 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc >index b82dec97ca..9793693a51 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/calendar.inc >@@ -80,7 +80,12 @@ > }); > }, > onClose: function( selectedDates, dateText, instance) { >- validate_date( selectedDates, instance ); >+ validate_date( dateText, instance ); >+ var thisInput = instance.input; >+ if ( thisInput.hasAttribute('data-start_for') ) { >+ var endPicker = document.querySelector("#"+thisInput.dataset.start_for)._flatpickr; >+ endPicker.set('minDate', selectedDates[0]); >+ } > }, > }); > >@@ -120,20 +125,7 @@ > } > > $(document).ready(function(){ >- > $(".flatpickr").flatpickr(); >- var startPicker = $(".flatpickrfrom").flatpickr({ >- onClose: function( selectedDates, dateText, instance) { >- validate_date( selectedDates, instance ); >- endPicker.set('minDate', selectedDates[0]); >- } >- }); >- var endPicker = $(".flatpickrto").flatpickr({ >- onClose: function( selectedDates, dateText, instance) { >- validate_date( selectedDates, instance ); >- }, >- }); > }); > >- > </script> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index 08d635b7ed..47c8db0f49 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -281,14 +281,14 @@ > [% IF ( reserve_in_future ) %] > <li> > <label for="from[% bibitemloo.biblionumber | html %]">Hold starts on date:</label> >- <input type="text" name="reserve_date_[% bibitemloo.biblionumber | html %]" id="from[% bibitemloo.biblionumber | html %]" size="10" /> >+ <input type="text" name="reserve_date_[% bibitemloo.biblionumber | html %]" id="from[% bibitemloo.biblionumber | html %]" data-start_for="to[% bibitemloo.biblionumber | html %]" size="10" class="flatpickr" /> > <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span> > </li> > [% END %] > > <li> > <label for="to[% bibitemloo.biblionumber | html %]">Hold not needed after:</label> >- <input type="text" name="expiration_date_[% bibitemloo.biblionumber | html %]" id="to[% bibitemloo.biblionumber | html %]" size="10" /> >+ <input type="text" name="expiration_date_[% bibitemloo.biblionumber | html %]" id="to[% bibitemloo.biblionumber | html %]" size="10" class="flatpickr" /> > <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber | html %]">[% INCLUDE 'date-format.inc' %]</span> > </li> > >@@ -669,24 +669,6 @@ > return true; > }); > >- [% FOREACH bibitemloo IN bibitemloop %] >- [% IF ( bibitemloo.holdable ) %] >- >- var startPicker[% bibitemloo.biblionumber | html %] = $("#from[% bibitemloo.biblionumber | html %]").flatpickr({ >- onClose: function( selectedDates, dateText, instance) { >- validate_date( selectedDates, instance ); >- endPicker[% bibitemloo.biblionumber | html %].set('minDate', selectedDates[0]); >- } >- }); >- var endPicker[% bibitemloo.biblionumber | html %] = $("#to[% bibitemloo.biblionumber | html %]").flatpickr({ >- onClose: function( selectedDates, dateText, instance) { >- validate_date( selectedDates, instance ); >- }, >- }); >- >- [% END %] >- [% END %] >- > }); > </script> > [% END %] >-- >2.20.1
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 29212
:
126229
|
126290
|
126298
|
126299
|
126820
|
126824
|
126825
|
126826
|
127250
|
129620
|
129638
|
129639
|
129640
|
129641
|
129642
|
130019