If enabled, the PC field in patron-info requests will return the non-translated profile name
<option name='patron_type_uses_code' value='true' />
-->
+
+ <!--
+ By default, most dates use the SIP date format. Some,
+ like circulation due dates, use the ISO8601 date format
+ instead. If this setting is set to true, all dates will
+ use the SIP date format.
+ <option name='use_sip_date_format' value='true' />
+ -->
</options>
<checkin_override>
use DateTime::Format::ISO8601;
use Encode;
use Unicode::Normalize;
+use Sip::Constants qw(SIP_DATETIME);
+
my $U = 'OpenILS::Application::AppUtils';
my $editor;
return "" unless $date;
- $date = DateTime::Format::ISO8601->new->
+ my $dt = DateTime::Format::ISO8601->new->
parse_datetime(OpenSRF::Utils::cleanse_ISO8601($date));
- my @time = localtime($date->epoch);
+ my @time = localtime($dt->epoch);
my $year = $time[5]+1900;
my $mon = $time[4]+1;
# Due dates need hyphen separators and time of day as well
if ($type eq 'due') {
- $date = sprintf("%04d-%02d-%02d %02d:%02d:%02d", $year, $mon, $day, $hour, $minute, $second);
+
+ my $use_sdf = $class->get_option_value('use_sip_date_format') | '';
+
+ if ($use_sdf =~ /true/i) {
+ $date = $dt->strftime(SIP_DATETIME);
+
+ } else {
+ $date = sprintf("%04d-%02d-%02d %02d:%02d:%02d",
+ $year, $mon, $day, $hour, $minute, $second);
+ }
}
syslog('LOG_DEBUG', "OILS: formatted date [type=$type]: $date");