Bugzilla – Attachment 82835 Details for
Bug 21885
Improve date selection on calendar for selecting the end date on a range
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21885: Calendar to-date starts before end-date
Bug-21885-Calendar-to-date-starts-before-end-date.patch (text/plain), 3.47 KB, created by
Owen Leonard
on 2018-12-04 13:33:16 UTC
(
hide
)
Description:
Bug 21885: Calendar to-date starts before end-date
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-12-04 13:33:16 UTC
Size:
3.47 KB
patch
obsolete
>From 2491942fca5d31557b1af009145b4e0bb2bba6ff Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@joensuu.fi> >Date: Tue, 27 Nov 2018 11:53:32 +0200 >Subject: [PATCH] Bug 21885: Calendar to-date starts before end-date > >When adding new holidays to the calendar, you pick the start date, >and then the end date, but the end date calendar will start from >current date, not from the picked start date. Sometimes this means >many extra clicks to pick an end date. > >Make the end date calendar start from the beginning date by default. > >Test plan: > >1) Go to the tools -> calendar >2) Pick a start date somewhere in the future, and then open the > end date calendar. Notice how it starts before the start date > of the date range. >3) Apply patch. >4) Pick a start date in the future. The end date calendar should > automatically default to the same date. >5) Change the start date a day backwards, note how the end date > does not change. >6) Change the start date after the end date, note how the end date > adjusts, so it is not in the past. > >Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi> > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../prog/en/modules/tools/holidays.tt | 24 +++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >index 4ad136e..ab93a5c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt >@@ -516,7 +516,19 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl > $("a.helptext").click(function(){ > $(this).parent().find(".hint").toggle(); return false; > }); >- $("#dateofrange").datepicker(); >+ $("#dateofrange").datepicker({ >+ beforeShow: function() { >+ var startdate = $("#jcalendar-container").datepicker("getDate"); >+ if (startdate !== null) { >+ var sd = new Date(startdate); >+ var ed = new Date($(this).datepicker("getDate")); >+ if (ed < sd) { >+ $(this).datepicker("setDate", startdate); >+ $(this).datepicker("option", "defaultDate", startdate); >+ } >+ } >+ } >+ }); > $("#datecancelrange").datepicker(); > $("#dateofrange").each(function () { this.value = "" }); > $("#datecancelrange").each(function () { this.value = "" }); >@@ -530,6 +542,16 @@ td.repeatableyearly a.ui-state-default { background: #FFCC66 none; color : Bl > }, > onSelect: function(dateText, inst) { > dateChanged($(this).datepicker("getDate")); >+ var enddate = $("#dateofrange").datepicker("getDate"); >+ $("#dateofrange").datepicker("option", "defaultDate", $(this).datepicker("getDate")); >+ if (enddate !== null) { >+ var ed = new Date(enddate); >+ var sd = new Date($(this).datepicker("getDate")); >+ if (ed < sd) { >+ $("#dateofrange").datepicker("setDate", $(this).datepicker("getDate")); >+ $("#dateofrange").datepicker("option", "defaultDate", enddate); >+ } >+ } > }, > defaultDate: new Date("[% keydate | html %]") > }); >-- >2.1.4
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 21885
:
82659
|
82835
|
84758