sub format_date {
my $class = shift;
my $date = shift;
+ my $type = shift || 'dob';
+
return "" unless $date;
$date = DateTime::Format::ISO8601->new->
$mon =~ s/^(\d)$/0$1/;
$day =~ s/^(\d)$/0$1/;
$date = "$year$mon$day";
- syslog('LOG_DEBUG', "OILS: formatted date: $date");
+
+ $date = $year.'-'.$mon.'-'.$day .' 0:00:00' if $type eq 'due';
+
+ syslog('LOG_DEBUG', "OILS: formatted date [type=$type]: $date");
return $date;
}
return 0;
}
- my $due = OpenILS::SIP->format_date($circ->due_date);
+ my $due = OpenILS::SIP->format_date($circ->due_date, 'due');
syslog('LOG_DEBUG', "OILS: Found item due date = $due");
return $due;
}
syslog('LOG_INFO', "OILS: Checkout succeeded");
my $circ = $resp->{payload}->{circ};
- $self->{'due'} = OpenILS::SIP->format_date($circ->due_date);
+ $self->{'due'} = OpenILS::SIP->format_date($circ->due_date, 'due');
$self->ok(1);
return 1;