Bug 22272

Summary: Calendar: When entering date ranges grey out dates in the past from the start date
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: ToolsAssignee: Emmi Takkinen <emmi.takkinen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: emmi.takkinen, fridolin.somers, lucas
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.11.00,19.05.04
Circulation function:
Bug Depends on: 21885    
Bug Blocks:    
Attachments: Bug 22272 - Calendar: When entering date ranges grey out dates in the past from the start date
Good enhancment, works well and passes qa tools. signing off
Bug 22272 - Calendar: When entering date... ...ranges grey out dates in the past from the start date
Bug 22272: Calendar: When entering date ranges grey out dates in the past from the start date

Description Katrin Fischer 2019-02-04 22:00:05 UTC
When working with date ranges in the calendar it would be nice if it was not possible to select dates in the past from the starting date.
Comment 1 Emmi Takkinen 2019-07-05 06:20:00 UTC
I looked into this and only calendar I could find allowing past date pick was one used to suspend all holds in circulation.tt and moremember.tt. Are there any other templates with this problem?
Comment 2 Katrin Fischer 2019-07-05 06:24:08 UTC
Hi Emmi, the calendar meant here is the holiday calendar under tools.
Comment 3 Emmi Takkinen 2019-07-05 07:05:30 UTC
Oh I see, sorry for misunderstanding. I'll write separate bug for that holds calendar then.
Comment 4 Katrin Fischer 2019-07-05 08:21:54 UTC
No need to be sorry, thx for looking into this!
Comment 5 Emmi Takkinen 2019-07-11 07:02:33 UTC
Created attachment 91456 [details] [review]
Bug 22272 - Calendar: When entering date ranges grey out dates in the past from the start date

In "Calendar" tool it's possible to pick dates before start
date as end date.

This patch sets end date calendars "minDate" as picked start day
to grey out past dates. Also reindents datepicker code for
better readability.

Test plan:
- Apply this patch
- Set start date from first calendar
- Set end date from second calendar
=> Dates before start date are greyed out
Comment 6 Lucas Gass (lukeg) 2019-07-22 22:32:32 UTC
Created attachment 91722 [details] [review]
Good enhancment, works well and passes qa tools. signing off

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

In "Calendar" tool it's possible to pick dates before start
date as end date.

This patch sets end date calendars "minDate" as picked start day
to grey out past dates. Also reindents datepicker code for
better readability.

Test plan:
- Apply this patch
- Set start date from first calendar
- Set end date from second calendar
=> Dates before start date are greyed out

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 7 Nadine Pierre 2019-07-26 18:51:37 UTC
Created attachment 91839 [details] [review]
Bug 22272 - Calendar: When entering date... ...ranges grey out dates in the past from the start date

In "Calendar" tool it's possible to pick dates before start
date as end date.

This patch sets end date calendars "minDate" as picked start day
to grey out past dates. Also reindents datepicker code for
better readability.

Test plan:
- Apply this patch
- Set start date from first calendar
- Set end date from second calendar
=> Dates before start date are greyed out

Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Comment 8 Katrin Fischer 2019-08-09 07:11:12 UTC
Celaned up the bug a bit as the same patch was attached several times and something happened to the subject. Will apply a cleaned up patch with all sign-off lines. 

Emmi, I notice that you use:
Emmi <emmi.takkinen@outlook.com>

That will make you show up as "Emmi" without your last name in the release notes. Not sure if this was intended or if you might like to update your git configuration!
Comment 9 Katrin Fischer 2019-08-09 07:14:12 UTC
Created attachment 92105 [details] [review]
Bug 22272: Calendar: When entering date ranges grey out dates in the past from the start date

In "Calendar" tool it's possible to pick dates before start
date as end date.

This patch sets end date calendars "minDate" as picked start day
to grey out past dates. Also reindents datepicker code for
better readability.

Test plan:
- Apply this patch
- Set start date from first calendar
- Set end date from second calendar
=> Dates before start date are greyed out

Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Martin Renvoize (ashimema) 2019-08-13 13:37:45 UTC
Nice work!

Pushed to master for 19.11.00
Comment 11 Fridolin Somers 2019-09-02 13:56:08 UTC
Patch only adds the line : 
  $("#dateofrange").datepicker( "option", "minDate", $(this).datepicker("getDate")); //ensure end date can't be before start date

Other changes are just spaces changes.
Comment 12 Fridolin Somers 2019-09-02 13:56:47 UTC
Pushed to 19.05.x for 19.05.04
Comment 13 Lucas Gass (lukeg) 2019-09-17 20:13:33 UTC
enhancement, choosing not to backport to 18.11.x