Bug 18447 - Datepicker only shows -10/+10 years for date of birth
Summary: Datepicker only shows -10/+10 years for date of birth
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Marcel de Rooy
URL:
Whiteboard:
Keywords:
Depends on: 12342
Blocks: 19402
  Show dependency treegraph
 
Reported: 2017-04-18 15:02 UTC by Nick Clemens
Modified: 2017-12-07 22:24 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18447 - Datepicker only shows -10/+10 years (1.14 KB, patch)
2017-04-18 15:03 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18447 - Datepicker only shows -10/+10 years (1.19 KB, patch)
2017-04-18 17:23 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18447 - Datepicker only shows -10/+10 years (1.39 KB, patch)
2017-04-18 19:04 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18447 - Datepicker only shows -10/+10 years (1.45 KB, patch)
2017-07-19 17:32 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18447 - Add changes to opac (1.05 KB, patch)
2017-07-19 17:32 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18447 - Remove redundant line (972 bytes, patch)
2017-07-19 17:32 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18447 - Datepicker only shows -10/+10 years (1.58 KB, patch)
2017-07-20 08:37 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18447 - Add changes to opac (1.18 KB, patch)
2017-07-20 08:38 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18447 - Remove redundant line (1.08 KB, patch)
2017-07-20 08:39 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 18447 - Datepicker only shows -10/+10 years (1.71 KB, patch)
2017-07-20 10:32 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 18447 - Add changes to opac (1.30 KB, patch)
2017-07-20 10:32 UTC, Josef Moravec
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 18447 - Remove redundant line (1.20 KB, patch)
2017-07-20 10:32 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 18447 - QA Followup - fix opac usage (1.56 KB, patch)
2017-07-28 10:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18447 - Datepicker only shows -10/+10 years (1.79 KB, patch)
2017-08-25 07:57 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18447 - Add changes to opac (1.38 KB, patch)
2017-08-25 07:57 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18447 - Remove redundant line (1.29 KB, patch)
2017-08-25 07:57 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18447 - QA Followup - fix opac usage (1.65 KB, patch)
2017-08-25 07:57 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18447: (follow-up) years range not dependent on current value (2.18 KB, patch)
2017-09-29 13:15 UTC, Fridolin SOMERS
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2017-04-18 15:02:06 UTC
When entering patrons they are often more than 10 years old - entering a birth date requires constantly clicking back 10 years on the date picker - we should load a few more years in the past

This was fixed in bug 12342 but that code is no longer used
Comment 1 Nick Clemens 2017-04-18 15:03:02 UTC
Created attachment 62300 [details] [review]
Bug 18447 - Datepicker only shows -10/+10 years

To test:
1 - Open some date pickers (patron entry, subscriptions, anywhere really)
2 - Note that default is 10 years in either direction, updated when you
select
3 - Apply patch
4 - Note we now get -100 years / +10 years from current selection
5 -Sign off
Comment 2 Jonathan Druart 2017-04-18 15:22:23 UTC
Why do you want -100 to be the default?
Comment 3 Nick Clemens 2017-04-18 16:10:25 UTC
In the previous patch it was set to -120, -100 seemed to be enough - basically we want a value where librarians don't have to perform several clicks to select a year.
Comment 4 Jonathan Druart 2017-04-18 16:14:55 UTC
Yes for the date of birth, but your patch modifies all the datepickers.
Comment 5 Nick Clemens 2017-04-18 17:23:23 UTC
Created attachment 62306 [details] [review]
Bug 18447 - Datepicker only shows -10/+10 years

To test:
1 - Open some date pickers (patron entry, subscriptions, anywhere really)
2 - Note that default is 10 years in either direction, updated when you
select
3 - Apply patch
4 - Note we now get -100 years / +10 years from current selection
5 -Sign off
Comment 6 Marc Véron 2017-04-18 19:04:35 UTC
Created attachment 62323 [details] [review]
Bug 18447 - Datepicker only shows -10/+10 years

To test:
1 - Open some date pickers (patron entry, subscriptions, anywhere really)
2 - Note that default is 10 years in either direction, updated when you
select
3 - Apply patch
4 - Note we now get -100 years / +10 years from current selection
5 -Sign off

Assume that test plan changed (birth date in staff only), works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Comment 7 Marc Véron 2017-04-18 19:06:03 UTC
Maybe bug title should be changed to reflect the new scope of this bug (date of birth in staff client only)
Comment 8 Jonathan Druart 2017-04-18 19:25:21 UTC
Why do you use the c-100;c+10 (relative to the current date) and not -120;+0 (relative to today)?
It does not make sense to have years in the future here
Comment 9 Jonathan Druart 2017-04-18 19:31:37 UTC
Note that the same fix should be applied to the OPAC.

Ccing Owen to get his feedback.
Comment 10 Owen Leonard 2017-04-19 17:00:17 UTC
I think -100 years / +10 years from current selection is a good default. I do think it makes sense to have future dates included in the default.
Comment 11 Owen Leonard 2017-04-19 17:26:10 UTC
Sorry, I misread the changes in the patch. I thought it was a global change, and it isn't. So I guess my question is: Why not make a global change, and set a different range for specific cases like date of birth?
Comment 12 Katrin Fischer 2017-05-01 13:07:09 UTC
Having more than 10 years past globally makes sense to me, but 100 seems a bit much. I am thinking of date pickers in acq/serials for example. Maybe:
Global: -20, +19
Date of birth. -100, +0 
But not opposed to a general change of -100, +10 either.
Comment 13 Nick Clemens 2017-07-19 17:32:29 UTC
Created attachment 65116 [details] [review]
Bug 18447 - Datepicker only shows -10/+10 years

This patch makes 2 changes:
1 - Global datepicker defaulted to c-100:c+10
2 - Dateofbirth datepicker defaulted to c-100:c

To test:
1 - Open some date pickers (patron entry, subscriptions, anywhere really)
  - Make sure to check some dateofbirth datepickers
2 - Note that default is 10 years in either direction, updated when you
select
3 - Apply patch
4 - Note we now get -100 years / +10 years from current selection
5 - Now find a dateofbirth datepicker and note default is -100:+0
6 - Sign off
Comment 14 Nick Clemens 2017-07-19 17:32:32 UTC
Created attachment 65117 [details] [review]
Bug 18447 - Add changes to opac
Comment 15 Nick Clemens 2017-07-19 17:32:36 UTC
Created attachment 65118 [details] [review]
Bug 18447 - Remove redundant line

This line was added by bug 12342 but seems to have stopped working.

These patches set default so this specific case should not be needed.
Comment 16 Marc Véron 2017-07-20 08:37:01 UTC
Created attachment 65135 [details] [review]
Bug 18447 - Datepicker only shows -10/+10 years

This patch makes 2 changes:
1 - Global datepicker defaulted to c-100:c+10
2 - Dateofbirth datepicker defaulted to c-100:c

To test:
1 - Open some date pickers (patron entry, subscriptions, anywhere really)
  - Make sure to check some dateofbirth datepickers
2 - Note that default is 10 years in either direction, updated when you
select
3 - Apply patch
4 - Note we now get -100 years / +10 years from current selection
5 - Now find a dateofbirth datepicker and note default is -100:+0
6 - Sign off

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 17 Marc Véron 2017-07-20 08:38:44 UTC
Created attachment 65136 [details] [review]
Bug 18447 - Add changes to opac

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 18 Marc Véron 2017-07-20 08:39:37 UTC
Created attachment 65137 [details] [review]
Bug 18447 - Remove redundant line

This line was added by bug 12342 but seems to have stopped working.

These patches set default so this specific case should not be needed.

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 19 Josef Moravec 2017-07-20 10:32:12 UTC
Created attachment 65140 [details] [review]
[SIGNED-OFF] Bug 18447 - Datepicker only shows -10/+10 years

This patch makes 2 changes:
1 - Global datepicker defaulted to c-100:c+10
2 - Dateofbirth datepicker defaulted to c-100:c

To test:
1 - Open some date pickers (patron entry, subscriptions, anywhere really)
  - Make sure to check some dateofbirth datepickers
2 - Note that default is 10 years in either direction, updated when you
select
3 - Apply patch
4 - Note we now get -100 years / +10 years from current selection
5 - Now find a dateofbirth datepicker and note default is -100:+0
6 - Sign off

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 20 Josef Moravec 2017-07-20 10:32:16 UTC
Created attachment 65141 [details] [review]
[SIGNED-OFF] Bug 18447 - Add changes to opac

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 21 Josef Moravec 2017-07-20 10:32:20 UTC
Created attachment 65142 [details] [review]
[SIGNED-OFF] Bug 18447 - Remove redundant line

This line was added by bug 12342 but seems to have stopped working.

These patches set default so this specific case should not be needed.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 22 Marcel de Rooy 2017-07-28 10:23:04 UTC
Please look at opac-memberentry
$( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" 

The name of the control is not #dateofbirth either.
Comment 23 Nick Clemens 2017-07-28 10:53:31 UTC
Created attachment 65309 [details] [review]
Bug 18447 - QA Followup - fix opac usage
Comment 24 Marcel de Rooy 2017-08-25 07:57:45 UTC
Created attachment 66459 [details] [review]
Bug 18447 - Datepicker only shows -10/+10 years

This patch makes 2 changes:
1 - Global datepicker defaulted to c-100:c+10
2 - Dateofbirth datepicker defaulted to c-100:c

To test:
1 - Open some date pickers (patron entry, subscriptions, anywhere really)
  - Make sure to check some dateofbirth datepickers
2 - Note that default is 10 years in either direction, updated when you
select
3 - Apply patch
4 - Note we now get -100 years / +10 years from current selection
5 - Now find a dateofbirth datepicker and note default is -100:+0
6 - Sign off

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 25 Marcel de Rooy 2017-08-25 07:57:50 UTC
Created attachment 66460 [details] [review]
Bug 18447 - Add changes to opac

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 26 Marcel de Rooy 2017-08-25 07:57:54 UTC
Created attachment 66461 [details] [review]
Bug 18447 - Remove redundant line

This line was added by bug 12342 but seems to have stopped working.

These patches set default so this specific case should not be needed.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 27 Marcel de Rooy 2017-08-25 07:57:59 UTC
Created attachment 66462 [details] [review]
Bug 18447 - QA Followup - fix opac usage

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 28 Marcel de Rooy 2017-08-25 07:58:26 UTC
Oh those SIGNED OFF labels again..
Comment 29 Jonathan Druart 2017-08-25 14:08:21 UTC
Set a date of birth for 100+ years people is not possible with these patches, that is why I suggested 120 in comment 8.
Comment 30 Jonathan Druart 2017-08-25 14:39:43 UTC
(In reply to Jonathan Druart from comment #29)
> Set a date of birth for 100+ years people is not possible with these
> patches, that is why I suggested 120 in comment 8.

Can be, with one more click.
Comment 31 Jonathan Druart 2017-08-25 14:45:32 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 32 Fridolin SOMERS 2017-09-29 13:13:58 UTC
Looks fine to me for patron create.
But years range is strange when a date of birth already exists, say "01/01/1950", years range is 1850 to 1950.

I propose a follow-up to set range from current year and 120 (instead of 100) years earlier.
Some people may have more than 100 years,maybe more often in the future.
(Lets hope we will soon all be cyborgs ~(o_o)~ )
Comment 33 Fridolin SOMERS 2017-09-29 13:15:38 UTC
Created attachment 67448 [details] [review]
Bug 18447: (follow-up) years range not dependent 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 34 Jonathan Druart 2017-09-29 14:33:46 UTC
(In reply to Fridolin SOMERS from comment #32)
> Looks fine to me for patron create.
> But years range is strange when a date of birth already exists, say
> "01/01/1950", years range is 1850 to 1950.
> 
> I propose a follow-up to set range from current year and 120 (instead of
> 100) years earlier.
> Some people may have more than 100 years,maybe more often in the future.
> (Lets hope we will soon all be cyborgs ~(o_o)~ )

We already discussed about that, please open a new bug report if you want to modify the current behaviour.
Comment 35 Fridolin SOMERS 2017-10-03 08:53:09 UTC
(In reply to Jonathan Druart from comment #34)
> (In reply to Fridolin SOMERS from comment #32)
> > Looks fine to me for patron create.
> > But years range is strange when a date of birth already exists, say
> > "01/01/1950", years range is 1850 to 1950.
> > 
> > I propose a follow-up to set range from current year and 120 (instead of
> > 100) years earlier.
> > Some people may have more than 100 years,maybe more often in the future.
> > (Lets hope we will soon all be cyborgs ~(o_o)~ )
> 
> We already discussed about that, please open a new bug report if you want to
> modify the current behaviour.

Ah indeed comment 8, sorry