Lines 544-550
Return the age of the patron
Link Here
|
544 |
sub get_age { |
544 |
sub get_age { |
545 |
my ($self) = @_; |
545 |
my ($self) = @_; |
546 |
my $today_str = dt_from_string->strftime("%Y-%m-%d"); |
546 |
my $today_str = dt_from_string->strftime("%Y-%m-%d"); |
547 |
my $dob_str = dt_from_string( $self->dateofbirth )->strftime("%Y-%m-%d"); |
547 |
my $dob_str = dt_from_string( $self->dateofbirth ) || return; |
|
|
548 |
$dob_str = $dob_str->strftime("%Y-%m-%d"); |
548 |
|
549 |
|
549 |
my ( $dob_y, $dob_m, $dob_d ) = split /-/, $dob_str; |
550 |
my ( $dob_y, $dob_m, $dob_d ) = split /-/, $dob_str; |
550 |
my ( $today_y, $today_m, $today_d ) = split /-/, $today_str; |
551 |
my ( $today_y, $today_m, $today_d ) = split /-/, $today_str; |