-This is effectivelyt a wrapper around output_pref for due dates
-the time portion is stripped if it is '23:59'
+ my $time_format = $force_time || C4::Context->preference('TimeFormat') || q{};
+ my $time = ( $time_format eq '12hr' ) ? '%I:%M %p' : '%H:%M';
+ my $date;
+ if ( $pref =~ m/^iso/ ) {
+ $date = $dateonly
+ ? $dt->strftime("%Y-%m-%d")
+ : $dt->strftime("%Y-%m-%d $time");
+ }
+ elsif ( $pref =~ m/^metric/ ) {
+ $date = $dateonly
+ ? $dt->strftime("%d/%m/%Y")
+ : $dt->strftime("%d/%m/%Y $time");
+ }
+ elsif ( $pref =~ m/^us/ ) {
+ $date = $dateonly
+ ? $dt->strftime("%m/%d/%Y")
+ : $dt->strftime("%m/%d/%Y $time");
+ }
+ else {
+ $date = $dateonly
+ ? $dt->strftime("%Y-%m-%d")
+ : $dt->strftime("%Y-%m-%d $time");
+ }