Bug 19402

Summary: Date of birth datepicker year range depending on current value
Product: Koha Reporter: Fridolin Somers <fridolin.somers>
Component: PatronsAssignee: Fridolin Somers <fridolin.somers>
Status: CLOSED INVALID QA Contact: Julian Maurice <julian.maurice>
Severity: minor    
Priority: P5 - low CC: alexbuckley, gmcharlt, jonathan.druart, julian.maurice, kyle.m.hall, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 18447    
Bug Blocks:    
Attachments: Bug 19402: Date of birth datepicker year range not depending on current value
Bug 19402: Date of birth datepicker year range not depending on current value

Description Fridolin Somers 2017-10-03 08:55:36 UTC
Bug 18447 sets for date of birth a year range "c-100:c" meaning current year and 100 years earlier.
This is good when imput is empty.
But when input already contains a date, say "01/01/1950", years range is 1850 to 1950.
Comment 1 Fridolin Somers 2017-10-03 09:04:14 UTC
Created attachment 67543 [details] [review]
Bug 19402: Date of birth datepicker year range not depending on current value

Bug 18447 sets for date of birth a year range "c-100:c" meaning current year and 100 years earlier.
This is good when imput is empty.
But when input already contains a date, say "01/01/1950", years range is 1850 to 1950.

This patch sets for date of birth a year range "-120:+0" to not be dependent on current value.
Some people may have more than 100 years (maybe more often in the future) so i choose to propose maximum 120 years old.

To test :
1) Go to intranet
2) Create a new patron
3) Click on date picker on "Date of birth" input
4) Look at available years in combobox, you see from 1897 to 2017
5) Edit an existing patron with for example date of birth in 1950
6) Repeat 3) and 4)
7) Go to OPAC
8) Login with a patron with for example date of birth in 1950
9) Go to "your personal details"
10) Repeate 3) and 4)
Comment 2 Nick Clemens 2017-10-03 13:52:33 UTC
(In reply to Fridolin SOMERS from comment #0)
> But when input already contains a date, say "01/01/1950", years range is
> 1850 to 1950.

Hmm...this is not what I see - if I edit a patron with a birth year of 1950 the datepicker goes from 1850 to 2017 - no matter how far back I set the year I can always slide the dropdown forward to 2017
Comment 3 Alex Buckley 2017-10-03 19:33:37 UTC
Created attachment 67574 [details] [review]
Bug 19402: Date of birth datepicker year range not depending on current value

Bug 18447 sets for date of birth a year range "c-100:c" meaning current year and 100 years earlier.
This is good when imput is empty.
But when input already contains a date, say "01/01/1950", years range is 1850 to 1950.

This patch sets for date of birth a year range "-120:+0" to not be dependent on current value.
Some people may have more than 100 years (maybe more often in the future) so i choose to propose maximum 120 years old.

To test :
1) Go to intranet
2) Create a new patron
3) Click on date picker on "Date of birth" input
4) Look at available years in combobox, you see from 1897 to 2017
5) Edit an existing patron with for example date of birth in 1950
6) Repeat 3) and 4)
7) Go to OPAC
8) Login with a patron with for example date of birth in 1950
9) Go to "your personal details"
10) Repeate 3) and 4)

Followed test plan, patch worked as described. Also ran QA test tools
and that passed the files modified in this patch
Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Comment 4 Julian Maurice 2017-10-13 13:10:33 UTC
(In reply to Nick Clemens from comment #2)
> (In reply to Fridolin SOMERS from comment #0)
> > But when input already contains a date, say "01/01/1950", years range is
> > 1850 to 1950.
> 
> Hmm...this is not what I see - if I edit a patron with a birth year of 1950
> the datepicker goes from 1850 to 2017 - no matter how far back I set the
> year I can always slide the dropdown forward to 2017

Same.
Fridolin, can you test this again and tell if the patch is still useful ?
Comment 5 Jonathan Druart 2017-11-27 17:43:01 UTC
Closing, please reopen if still needed.