Bug 21885 - Improve date selection on calendar for selecting the end date on a range
Summary: Improve date selection on calendar for selecting the end date on a range
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Holidays (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: paxed
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 22272
  Show dependency treegraph
 
Reported: 2018-11-27 10:04 UTC by paxed
Modified: 2019-02-25 09:43 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Calendar to-date starts before end-date (3.43 KB, patch)
2018-11-27 10:06 UTC, paxed
Details | Diff | Splinter Review
Bug 21885: Calendar to-date starts before end-date (3.47 KB, patch)
2018-12-04 13:33 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 21885: Calendar to-date starts before end-date (3.53 KB, patch)
2019-02-04 21:56 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2018-11-27 10:04:50 UTC
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.
Comment 1 paxed 2018-11-27 10:06:07 UTC Comment hidden (obsolete)
Comment 2 Pierre-Marc Thibault 2018-11-30 19:51:20 UTC
At step 4, the field "To date:" is not filled with the start date, I don't know if it's intended.
Comment 3 Owen Leonard 2018-12-04 13:33:16 UTC
Created attachment 82835 [details] [review]
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>
Comment 4 Owen Leonard 2018-12-04 13:34:27 UTC
A nice follow-up to this would be to disable dates before the chosen start date.
Comment 5 Katrin Fischer 2019-02-04 21:56:50 UTC
Created attachment 84758 [details] [review]
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>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2019-02-04 22:06:59 UTC
This is certainly a nice little improvement. I agree with Owen that greying out dates would be another nice addition, but I think we can handle that on a separate bug report:

Bug 22272 - Calendar: When entering date ranges grey out dates in the past from the start date

I've rephrased the title a bit as this does a bit more than prevent to before start... but maybe it can still be improved.
Comment 7 Nick Clemens 2019-02-11 18:39:03 UTC
Awesome work all!

Pushed to master for 19.05
Comment 8 Martin Renvoize 2019-02-12 13:11:57 UTC
Pushed to 18.11.x for 18.11.03
Comment 9 Lucas Gass 2019-02-12 22:37:22 UTC
backported to 18.05.x for 18.05.09
Comment 10 Fridolin SOMERS 2019-02-25 09:43:53 UTC
I prefer not to push to 17.11.x