diff --git a/Koha/REST/V1/Patrons.pm b/Koha/REST/V1/Patrons.pm index a43d57114b..8d298a0aab 100644 --- a/Koha/REST/V1/Patrons.pm +++ b/Koha/REST/V1/Patrons.pm @@ -19,6 +19,7 @@ use Modern::Perl; use Mojo::Base 'Mojolicious::Controller'; +use Koha::DateUtils; use Koha::Patrons; use Scalar::Util qw(blessed); @@ -365,6 +366,14 @@ sub _to_model { $patron->{gonenoaddress} = ($patron->{gonenoaddress}) ? 1 : 0; } + if ( exists $patron->{lastseen} ) { + $patron->{lastseen} = output_pref({ dt => dt_from_string( $patron->{lastseen} ), dateformat => 'sql' }); + } + + if ( exists $patron->{updated_on} ) { + $patron->{updated_on} = output_pref({ dt => dt_from_string( $patron->{updated_on} ), dateformat => 'sql' }); + } + return $patron; }