Bug 14763 - show patron's age
Summary: show patron's age
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-31 18:47 UTC by Nicole C. Engard
Modified: 2017-06-14 22:11 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 14763: Calculate and display patron age (2.42 KB, patch)
2015-12-17 22:59 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 14763: Calculate and display patron age (2.59 KB, patch)
2016-01-13 09:05 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14763: Calculate and display patron age (2.54 KB, patch)
2016-01-13 23:38 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 14763: Calculate and display patron age (2.69 KB, patch)
2016-01-14 09:46 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14763: Calculate and display patron age (2.75 KB, patch)
2016-01-14 11:43 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2015-08-31 18:47:45 UTC
It would be nice if Koha calculated the patron's age to display on the patron record near the birthday.
Comment 1 Joonas Kylmälä 2015-09-02 09:06:44 UTC
I agree with you!
Comment 2 Aleisha Amohia 2015-12-17 22:59:22 UTC Comment hidden (obsolete)
Comment 3 Aleisha Amohia 2016-01-12 23:56:49 UTC
This could use a sign off!
Comment 4 Marc Véron 2016-01-13 09:03:26 UTC
Testing for today (13/01/2016)

Date of birth:
12/01/2000
Expecting: 16 years old 
Display: 16 years

Date of birth:
13/01/2000
Expecting: 16 years old 
Display: 16 years

Date of birth:
14/01/2000
Expecting: 15 years old 
Display: 15 years

BTW: Applied on top of this Bug 15206 - Show patron's age when filling date of birth in memberentry.pl, works fine, no conflicts.
Comment 5 Marc Véron 2016-01-13 09:05:22 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2016-01-13 10:14:43 UTC
Doesn't it make more sense to display it like:
  Date of birth: dd/mm/yyyy (xx years)
?
Comment 7 Aleisha Amohia 2016-01-13 23:33:51 UTC
(In reply to Jonathan Druart from comment #6)
> Doesn't it make more sense to display it like:
>   Date of birth: dd/mm/yyyy (xx years)
> ?

Patch to come
Comment 8 Aleisha Amohia 2016-01-13 23:38:01 UTC Comment hidden (obsolete)
Comment 9 Marc Véron 2016-01-14 09:46:43 UTC Comment hidden (obsolete)
Comment 10 Barry Cannon 2016-01-14 10:37:52 UTC
If a patron has no date of birth set the display is "Age:  2016 years", which doesn't look right. Maybe set a string of "unset" or "no DOB" if there isn't a date of birth on the patron record?
Comment 11 Jonathan Druart 2016-01-14 10:48:20 UTC
That's exactly what I was writing(In reply to Barry Cannon from comment #10)
> If a patron has no date of birth set the display is "Age:  2016 years",
> which doesn't look right. Maybe set a string of "unset" or "no DOB" if there
> isn't a date of birth on the patron record?

Are you sure? Nothing is displayed for me if there is no date of birth set.
Comment 12 Barry Cannon 2016-01-14 11:01:39 UTC
Strange, I can't recreate that problem now. I had removed this branch (and I observed the problem there) and re-based and applied it again. Sure enough, there is no problem now. Sorry!
Comment 13 Jonathan Druart 2016-01-14 11:43:31 UTC
Created attachment 46647 [details] [review]
Bug 14763: Calculate and display patron age

To test:
1) Go to patron Details page (ie http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51)
2) Confirm that '(x years)' is showing next to the Date of Birth and is correct according to DOB (ie if DOB: 30/11/1996, Age: 19 years)
3) Edit date of birth to be a month later (ie from 30 November to 30 December) so that, as of the date you are testing, the patron has not had their birthday yet
4) Confirm that age changes to be one year younger
5) Edit date of birth to be a different year
6) Confirm that age changes accordingly

Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 14 Brendan Gallagher 2016-01-27 06:10:51 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!