Bugzilla – Attachment 145981 Details for
Bug 31665
952$d ( Date acquired ) no longer prefills with todays date when focused
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31665: Set today date for date cataloguing plugin
Bug-31665-Set-today-date-for-date-cataloguing-plug.patch (text/plain), 1.71 KB, created by
ByWater Sandboxes
on 2023-02-01 23:01:05 UTC
(
hide
)
Description:
Bug 31665: Set today date for date cataloguing plugin
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2023-02-01 23:01:05 UTC
Size:
1.71 KB
patch
obsolete
>From 78ae8f4d6bf524d173734d5f9305872ca2709b5c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 1 Feb 2023 10:47:27 +0100 >Subject: [PATCH] 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> >--- > cataloguing/value_builder/dateaccessioned.pl | 13 +++++-------- > 1 file changed, 5 insertions(+), 8 deletions(-) > >diff --git a/cataloguing/value_builder/dateaccessioned.pl b/cataloguing/value_builder/dateaccessioned.pl >index f0d89b528f..48c44e5647 100755 >--- a/cataloguing/value_builder/dateaccessioned.pl >+++ b/cataloguing/value_builder/dateaccessioned.pl >@@ -21,24 +21,21 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Koha::DateUtils qw( flatpickr_date_format ); >- > my $builder = sub { > my ( $params ) = @_; > my $function_name = $params->{id}; > >- my $dateformat = flatpickr_date_format(); >- > my $res = <<END_OF_JS; > <script> > /* from: cataloguing/value_builder/dateaccessioned.pl */ > > \$(document).ready(function(){ > \$("#$function_name").flatpickr({ >- altInput: true, >- altFormat: "$dateformat", >- altInputClass: "input_marceditor flatpickr-input", >- dateFormat: "Y-m-d" >+ onOpen: function(selectedDates, dateStr, instance) { >+ if (dateStr == '') { >+ instance.setDate(new Date()); >+ } >+ } > }); > }); > >-- >2.30.2
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 31665
:
145923
|
145979
|
145981
|
147721