Bugzilla – Attachment 126631 Details for
Bug 29278
write_age function broken by Flatpickr conversion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29278: Fix selector of hint used to show age
Bug-29278-Fix-selector-of-hint-used-to-show-age.patch (text/plain), 2.88 KB, created by
David Nind
on 2021-10-20 22:55:54 UTC
(
hide
)
Description:
Bug 29278: Fix selector of hint used to show age
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-10-20 22:55:54 UTC
Size:
2.88 KB
patch
obsolete
>From 56f45697c4393483fb3cae71aaf3a4dbbea52a5d Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 19 Oct 2021 16:20:19 +0000 >Subject: [PATCH] Bug 29278: Fix selector of hint used to show age > >This patch modifies the patron entry form to correct a problem with the >write_age() function introduced by the switch to Flatpickr on this page >(Bug 28937). > >Rather than selecting the element based on the sequence of elements on >the page, we should add an ID for direct selection. > >To test, apply the patch and go to Patrons. > >- Locate a patron record which has a date of birth saved. > - When you open that patron for editing, you should see their age > displayed below the date of birth input field, e.g. "Age: 23 years 9 > months." > - Changing the date in the date of birth field should update the age > string correctly. >- Go to Patrons -> New patron. > - The date of birth field should have a hint showing the required date > format, e.g. "(DD.MM.YYYY)". > - When you select a date of birth using the Flatpickr calendar the age > string should be updated correctly. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/js/members.js | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >index 204c59723e..ebd034a5f0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt >@@ -354,7 +354,7 @@ legend:hover { > [% IF ( ERROR_dateofbirth ) %] > <span class="required">(Error)</span> > [% END %] >- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ <div id="dateofbirth_hint" class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > [% END # /UNLESS nodateofbirth %] > [% UNLESS noinitials %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/members.js b/koha-tmpl/intranet-tmpl/prog/js/members.js >index 73c15021cf..a9e6a870ae 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/members.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/members.js >@@ -148,7 +148,7 @@ function CalculateAge(dateofbirth) { > } > > function write_age() { >- var hint = $("#dateofbirth").siblings(".hint").first(); >+ var hint = $("#dateofbirth_hint"); > hint.html(dateformat); > > var age = CalculateAge(document.form.dateofbirth.value); >-- >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 29278
:
126528
|
126631
|
126794