It would be nice if Koha calculated the patron's age to display on the patron record near the birthday.
I agree with you!
Created attachment 45790 [details] [review] Bug 14763: Calculate and display patron age This patch uses the GetAge function from C4::Members to calculate the patron's age and display it. To test: 1) Go to patron Details page (ie http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51) 2) Confirm that 'Age:' is showing under 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
This could use a sign off!
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.
Created attachment 46570 [details] [review] Bug 14763: Calculate and display patron age This patch uses the GetAge function from C4::Members to calculate the patron's age and display it. To test: 1) Go to patron Details page (ie http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51) 2) Confirm that 'Age:' is showing under 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 Followed test plan, works as expected. Signed-off-by: Marc Véron <veron@veron.ch>
Doesn't it make more sense to display it like: Date of birth: dd/mm/yyyy (xx years) ?
(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
Created attachment 46626 [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
Created attachment 46645 [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>
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?
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.
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!
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>
Pushed to Master - Should be in the May 2016 release. Thanks!