From 774005e3c994f8ea28d2a22148a883d3415269d4 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 27 Dec 2019 12:15:39 -0300 Subject: [PATCH] Bug 23893: (QA follow-up) Explicit date format This patch makes the input date format explicit. It also adds a missing POD. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson --- Koha/Patron.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index f23ddc10eb..775ccd6d85 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -1570,17 +1570,26 @@ sub to_api { return $json_patron; } +=head3 attributes_from_api + + my $attrs = $patron->attributes_from_api( $attrs ); + +Overloaded method that implement specific data transformations after +calling the original Koha::Object->attributes_from_api method. + +=cut + sub attributes_from_api { my ( $self, $attrs ) = @_; $attrs = $self->SUPER::attributes_from_api( $attrs ); if ( exists $attrs->{lastseen} ) { - $attrs->{lastseen} = dt_from_string($attrs->{lastseen}); + $attrs->{lastseen} = dt_from_string($attrs->{lastseen}, 'rfc3339'); } if ( exists $attrs->{updated_on} ) { - $attrs->{updated_on} = dt_from_string($attrs->{updated_on}); + $attrs->{updated_on} = dt_from_string($attrs->{updated_on}, 'rfc3339'); } return $attrs; -- 2.39.5