Address long-standing typo: clense_ISO8601, matching change to OpenSRF-trunk.
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Jan 2010 02:07:45 +0000 (02:07 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 19 Jan 2010 02:07:45 +0000 (02:07 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15335 dcc99617-32d9-48b4-a31d-7c20da2025e4

16 files changed:
Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/NonCat.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/ScriptBuilder.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
Open-ILS/src/perlmods/OpenILS/Application/Trigger.pm
Open-ILS/src/perlmods/OpenILS/Application/Trigger/Reactor.pm
Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm
Open-ILS/src/perlmods/OpenILS/SIP.pm
Open-ILS/src/perlmods/OpenILS/SIP/Patron.pm
Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Open-ILS/src/support-scripts/generate_circ_notices.pl

index b16c819..0fa2a45 100644 (file)
@@ -1853,7 +1853,7 @@ sub checkedout_count {
 
        my (@out,@overdue);
        for my $c (@$circs) {
-               my $due_dt = $parser->parse_datetime( clense_ISO8601( $c->due_date ) );
+               my $due_dt = $parser->parse_datetime( cleanse_ISO8601( $c->due_date ) );
                my $due = $due_dt->epoch;
 
                if ($due < DateTime->today->epoch) {
@@ -1942,7 +1942,7 @@ sub _checked_out_WHAT {
        my (@out,@overdue);
        for my $c (@$circs) {
                if( $c->due_date ) {
-                       my $due_dt = $parser->parse_datetime( clense_ISO8601( $c->due_date ) );
+                       my $due_dt = $parser->parse_datetime( cleanse_ISO8601( $c->due_date ) );
                        my $due = $due_dt->epoch;
                        if ($due < DateTime->today->epoch) {
                                push @overdue, $c->id;
index b1f30d6..7d71984 100644 (file)
@@ -368,7 +368,7 @@ sub set_circ_claims_returned {
 
     if( $backdate ) {
         # make it look like the circ stopped at the cliams returned time
-        $circ->stop_fines_time(clense_ISO8601($backdate));
+        $circ->stop_fines_time(cleanse_ISO8601($backdate));
         my $evt = OpenILS::Application::Circ::CircCommon->void_overdues($e, $circ, $backdate);
         return $evt if $evt;
     }
@@ -451,8 +451,8 @@ sub post_checkin_backdate_circ_impl {
         $backdate and $circ->checkin_time;
 
     # update the checkin and stop_fines times to reflect the new backdate
-    $circ->stop_fines_time(clense_ISO8601($backdate));
-    $circ->checkin_time(clense_ISO8601($backdate));
+    $circ->stop_fines_time(cleanse_ISO8601($backdate));
+    $circ->checkin_time(cleanse_ISO8601($backdate));
     $e->update_action_circulation($circ) or return $e->die_event;
 
     # now void the overdues "erased" by the back-dating
@@ -489,7 +489,7 @@ sub set_circ_due_date {
         or return $e->die_event;
 
     return $e->die_event unless $e->allowed('CIRC_OVERRIDE_DUE_DATE', $circ->circ_lib);
-       $date = clense_ISO8601($date);
+       $date = cleanse_ISO8601($date);
        $circ->due_date($date);
     $e->update_action_circulation($circ) or return $e->die_event;
     $e->commit;
@@ -545,7 +545,7 @@ sub create_in_house_use {
        }
 
        if( $use_time ne 'now' ) {
-               $use_time = clense_ISO8601($use_time);
+               $use_time = cleanse_ISO8601($use_time);
                $logger->debug("in_house_use setting use time to $use_time");
        }
 
index e2d8ac8..d910c8b 100644 (file)
@@ -932,7 +932,7 @@ sub do_copy_checks {
 
                 if($auto_renew_intvl) {
                     my $intvl_seconds = OpenSRF::Utils->interval_to_seconds($auto_renew_intvl);
-                    my $checkout_time = DateTime::Format::ISO8601->new->parse_datetime( clense_ISO8601($old_circ->xact_start) );
+                    my $checkout_time = DateTime::Format::ISO8601->new->parse_datetime( cleanse_ISO8601($old_circ->xact_start) );
 
                     if(DateTime->now > $checkout_time->add(seconds => $intvl_seconds)) {
                         $payload->{auto_renew} = 1;
@@ -1721,7 +1721,7 @@ sub build_checkout_circ_object {
     # if the user provided an overiding checkout time,
     # (e.g. the checkout really happened several hours ago), then
     # we apply that here.  Does this need a perm??
-    $circ->xact_start(clense_ISO8601($self->checkout_time))
+    $circ->xact_start(cleanse_ISO8601($self->checkout_time))
         if $self->checkout_time;
 
     # if a patron is renewing, 'requestor' will be the patron
@@ -1809,7 +1809,7 @@ sub booking_adjusted_due_date {
         return $self->bail_on_events($self->editor->event)
             unless $self->editor->allowed('CIRC_OVERRIDE_DUE_DATE', $self->circ_lib);
 
-       $circ->due_date(clense_ISO8601($self->due_date));
+       $circ->due_date(cleanse_ISO8601($self->due_date));
 
     } else {
 
@@ -1834,14 +1834,14 @@ sub booking_adjusted_due_date {
         $booking_ses->disconnect;
         
         my $dt_parser = DateTime::Format::ISO8601->new;
-        my $due_date = $dt_parser->parse_datetime( clense_ISO8601($circ->due_date) );
+        my $due_date = $dt_parser->parse_datetime( cleanse_ISO8601($circ->due_date) );
 
         for my $bid (@$bookings) {
 
             my $booking = $self->editor->retrieve_booking_reservation( $bid );
 
-            my $booking_start = $dt_parser->parse_datetime( clense_ISO8601($booking->start_time) );
-            my $booking_end = $dt_parser->parse_datetime( clense_ISO8601($booking->end_time) );
+            my $booking_start = $dt_parser->parse_datetime( cleanse_ISO8601($booking->start_time) );
+            my $booking_end = $dt_parser->parse_datetime( cleanse_ISO8601($booking->end_time) );
 
             return $self->bail_on_events( OpenILS::Event->new('COPY_RESERVED') )
                 if ($booking_start < DateTime->now);
@@ -1862,7 +1862,7 @@ sub booking_adjusted_due_date {
             $new_circ_duration++ if $new_circ_duration % 86400 == 0;
             $circ->duration("$new_circ_duration seconds");
 
-            $circ->due_date(clense_ISO8601($due_date->strftime('%FT%T%z')));
+            $circ->due_date(cleanse_ISO8601($due_date->strftime('%FT%T%z')));
             $changed = 1;
         }
 
@@ -1884,7 +1884,7 @@ sub apply_modified_due_date {
         return $self->bail_on_events($self->editor->event)
             unless $self->editor->allowed('CIRC_OVERRIDE_DUE_DATE', $self->circ_lib);
 
-      $circ->due_date(clense_ISO8601($self->due_date));
+      $circ->due_date(cleanse_ISO8601($self->due_date));
 
    } else {
 
@@ -2012,7 +2012,7 @@ sub checkout_noncat {
 
    my $lib      = $self->noncat_circ_lib || $self->editor->requestor->ws_ou;
    my $count    = $self->noncat_count || 1;
-   my $cotime   = clense_ISO8601($self->checkout_time) || "";
+   my $cotime   = cleanse_ISO8601($self->checkout_time) || "";
 
    $logger->info("circulator: circ creating $count noncat circs with checkout time $cotime");
 
index e60b024..aabe99a 100644 (file)
@@ -884,7 +884,7 @@ sub _hold_status {
 
         my $transit = $e->search_action_hold_transit_copy({hold => $hold->id})->[0];
         my $start_time = ($transit) ? $transit->dest_recv_time : $hold->capture_time;
-        $start_time = DateTime::Format::ISO8601->new->parse_datetime(clense_ISO8601($start_time));
+        $start_time = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($start_time));
         my $end_time = $start_time->add(seconds => OpenSRF::Utils::interval_to_seconds($hs_wait_interval));
 
         return 5 if $end_time > DateTime->now;
index c8c1978..1ddfb83 100644 (file)
@@ -174,7 +174,7 @@ sub noncat_due_date {
        my $otype = $e->retrieve_config_non_cataloged_type($circ->item_type) 
                or return $e->die_event;
 
-       my $duedate = $_dt_parser->parse_datetime( clense_ISO8601($circ->circ_time) );
+       my $duedate = $_dt_parser->parse_datetime( cleanse_ISO8601($circ->circ_time) );
        $duedate = $duedate
                ->add( seconds => interval_to_seconds($otype->circ_duration) )
                ->strftime('%FT%T%z');
index 0b9ebbc..7589cab 100644 (file)
@@ -226,7 +226,7 @@ sub fetch_user_data {
                        unless $U->is_true($patron->card->active);
        
                my $expire = DateTime::Format::ISO8601->new->parse_datetime(
-                       clense_ISO8601($patron->expire_date));
+                       cleanse_ISO8601($patron->expire_date));
        
                return OpenILS::Event->new('PATRON_ACCOUNT_EXPIRED')
                        if( CORE::time > $expire->epoch ) ;
index 840b254..ecd9960 100644 (file)
@@ -690,7 +690,7 @@ sub generate_fines {
                        $log->info("Processing circ ".$c->id."...\n");
 
 
-                       my $due_dt = $parser->parse_datetime( clense_ISO8601( $c->$due_date_method ) );
+                       my $due_dt = $parser->parse_datetime( cleanse_ISO8601( $c->$due_date_method ) );
        
                        my $due = $due_dt->epoch;
                        my $now = time;
@@ -733,8 +733,8 @@ sub generate_fines {
        
                        my $last_fine;
                        if ($fine) {
-                               $client->respond( "Last billing time: ".$fine->billing_ts." (clensed fromat: ".clense_ISO8601( $fine->billing_ts ).")");
-                               $last_fine = $parser->parse_datetime( clense_ISO8601( $fine->billing_ts ) )->epoch;
+                               $client->respond( "Last billing time: ".$fine->billing_ts." (clensed format: ".cleanse_ISO8601( $fine->billing_ts ).")");
+                               $last_fine = $parser->parse_datetime( cleanse_ISO8601( $fine->billing_ts ) )->epoch;
                        } else {
                                $log->info( "Potential first billing for circ ".$c->id );
                                $last_fine = $due;
@@ -1003,7 +1003,7 @@ sub new_hold_copy_targeter {
                        $_->delete for (@oldmaps);
 
                        if ($hold->expire_time) {
-                               my $ex_time = $parser->parse_datetime( clense_ISO8601( $hold->expire_time ) );
+                               my $ex_time = $parser->parse_datetime( cleanse_ISO8601( $hold->expire_time ) );
                                if ( DateTime->compare($ex_time, DateTime->now) < 0 ) {
 
                                        # cancel cause = un-targeted expiration
@@ -1369,7 +1369,7 @@ sub reservation_targeter {
 
                        die "OK\n" if (!$bresv or $bresv->capture_time or $bresv->cancel_time);
 
-                       my $end_time = $parser->parse_datetime( clense_ISO8601( $bresv->end_time ) );
+                       my $end_time = $parser->parse_datetime( cleanse_ISO8601( $bresv->end_time ) );
                        if (DateTime->compare($end_time, DateTime->now) < 0) {
 
                                # cancel cause = un-targeted expiration
@@ -1432,8 +1432,8 @@ sub reservation_targeter {
 
                     if (@$circs) {
                         my $due_date = $circs->[0]->due_date;
-                                   $due_date = $parser->parse_datetime( clense_ISO8601( $due_date ) );
-                                   my $start_time = $parser->parse_datetime( clense_ISO8601( $bresv->start_time ) );
+                                   $due_date = $parser->parse_datetime( cleanse_ISO8601( $due_date ) );
+                                   my $start_time = $parser->parse_datetime( cleanse_ISO8601( $bresv->start_time ) );
                         next if (DateTime->compare($start_time, $due_date) < 0);
                         push @good_resources, $res;
                     }
index a88755f..c3e78bc 100644 (file)
@@ -252,8 +252,8 @@ sub make_closure_spanset {
 
         $spanset = $spanset->union(
             DateTime::Span->new(
-                start => $_dt_parser->parse_datetime(clense_ISO8601($c->{close_start})),
-                end   => $_dt_parser->parse_datetime(clense_ISO8601($c->{close_end}))
+                start => $_dt_parser->parse_datetime(cleanse_ISO8601($c->{close_start})),
+                end   => $_dt_parser->parse_datetime(cleanse_ISO8601($c->{close_end}))
             )
         );
     }
@@ -282,7 +282,7 @@ sub new_org_closed_overlap {
                  LIMIT 1
        SQL
 
-       $date = clense_ISO8601($date);
+       $date = cleanse_ISO8601($date);
 
     my $target_date = $_dt_parser->parse_datetime( $date );
        my ($begin, $end) = ($target_date, $target_date);
@@ -301,7 +301,7 @@ sub new_org_closed_overlap {
                        $begin->subtract( minutes => 1 );
 
                        while ( my $_b = new_org_closed_overlap($self, $client, $ou, $begin->strftime('%FT%T%z'), -1, 1 ) ) {
-                               $begin = $_dt_parser->parse_datetime( clense_ISO8601($_b->{start}) );
+                               $begin = $_dt_parser->parse_datetime( cleanse_ISO8601($_b->{start}) );
                        }
                }
 
@@ -309,7 +309,7 @@ sub new_org_closed_overlap {
                        $end->add( minutes => 1 );
 
                        while ( my $_a = new_org_closed_overlap($self, $client, $ou, $end->strftime('%FT%T%z'), 1, 1 ) ) {
-                               $end = $_dt_parser->parse_datetime( clense_ISO8601($_a->{end}) );
+                               $end = $_dt_parser->parse_datetime( cleanse_ISO8601($_a->{end}) );
                        }
                }
     }
@@ -326,7 +326,7 @@ sub new_org_closed_overlap {
             $begin->subtract( minutes => 1 );
 
             while ( my $_b = new_org_closed_overlap($self, $client, $ou, $begin->strftime('%FT%T%z'), -1 ) ) {
-                $begin = $_dt_parser->parse_datetime( clense_ISO8601($_b->{start}) );
+                $begin = $_dt_parser->parse_datetime( cleanse_ISO8601($_b->{start}) );
             }
         }
        
@@ -337,7 +337,7 @@ sub new_org_closed_overlap {
 
 
             while ( my $_b = new_org_closed_overlap($self, $client, $ou, $end->strftime('%FT%T%z'), -1 ) ) {
-                $end = $_dt_parser->parse_datetime( clense_ISO8601($_b->{end}) );
+                $end = $_dt_parser->parse_datetime( cleanse_ISO8601($_b->{end}) );
             }
         }
     }
@@ -374,23 +374,23 @@ sub org_closed_overlap {
           LIMIT 1
     SQL
 
-    $date = clense_ISO8601($date);
+    $date = cleanse_ISO8601($date);
     my ($begin, $end) = ($date,$date);
 
     my $hoo = actor::org_unit::hours_of_operation->retrieve($ou);
 
     if (my $closure = actor::org_unit::closed_date->db_Main->selectrow_hashref( $sql, {}, $date, $ou )) {
-        $begin = clense_ISO8601($closure->{close_start});
-        $end = clense_ISO8601($closure->{close_end});
+        $begin = cleanse_ISO8601($closure->{close_start});
+        $end = cleanse_ISO8601($closure->{close_end});
 
         if ( $direction <= 0 ) {
             $before = $_dt_parser->parse_datetime( $begin );
             $before->subtract( minutes => 1 );
 
             while ( my $_b = org_closed_overlap($self, $client, $ou, $before->strftime('%FT%T%z'), -1, 1 ) ) {
-                $before = $_dt_parser->parse_datetime( clense_ISO8601($_b->{start}) );
+                $before = $_dt_parser->parse_datetime( cleanse_ISO8601($_b->{start}) );
             }
-            $begin = clense_ISO8601($before->strftime('%FT%T%z'));
+            $begin = cleanse_ISO8601($before->strftime('%FT%T%z'));
         }
 
         if ( $direction >= 0 ) {
@@ -398,9 +398,9 @@ sub org_closed_overlap {
             $after->add( minutes => 1 );
 
             while ( my $_a = org_closed_overlap($self, $client, $ou, $after->strftime('%FT%T%z'), 1, 1 ) ) {
-                $after = $_dt_parser->parse_datetime( clense_ISO8601($_a->{end}) );
+                $after = $_dt_parser->parse_datetime( cleanse_ISO8601($_a->{end}) );
             }
-            $end = clense_ISO8601($after->strftime('%FT%T%z'));
+            $end = cleanse_ISO8601($after->strftime('%FT%T%z'));
         }
     }
 
@@ -414,7 +414,7 @@ sub org_closed_overlap {
 
                 my $count = 1;
                 while ($hoo->$begin_open_meth eq '00:00:00' and $hoo->$begin_close_meth eq '00:00:00') {
-                    $begin = clense_ISO8601($_dt_parser->parse_datetime( $begin )->subtract( days => 1)->strftime('%FT%T%z'));
+                    $begin = cleanse_ISO8601($_dt_parser->parse_datetime( $begin )->subtract( days => 1)->strftime('%FT%T%z'));
                     $begin_dow++;
                     $begin_dow %= 7;
                     $count++;
@@ -427,7 +427,7 @@ sub org_closed_overlap {
                     $before = $_dt_parser->parse_datetime( $begin );
                     $before->subtract( minutes => 1 );
                     while ( my $_b = org_closed_overlap($self, $client, $ou, $before->strftime('%FT%T%z'), -1 ) ) {
-                        $before = $_dt_parser->parse_datetime( clense_ISO8601($_b->{start}) );
+                        $before = $_dt_parser->parse_datetime( cleanse_ISO8601($_b->{start}) );
                     }
                 }
             }
@@ -439,7 +439,7 @@ sub org_closed_overlap {
     
                 $count = 1;
                 while ($hoo->$end_open_meth eq '00:00:00' and $hoo->$end_close_meth eq '00:00:00') {
-                    $end = clense_ISO8601($_dt_parser->parse_datetime( $end )->add( days => 1)->strftime('%FT%T%z'));
+                    $end = cleanse_ISO8601($_dt_parser->parse_datetime( $end )->add( days => 1)->strftime('%FT%T%z'));
                     $end_dow++;
                     $end_dow %= 7;
                     $count++;
@@ -453,9 +453,9 @@ sub org_closed_overlap {
                     $after->add( minutes => 1 );
 
                     while ( my $_a = org_closed_overlap($self, $client, $ou, $after->strftime('%FT%T%z'), 1 ) ) {
-                        $after = $_dt_parser->parse_datetime( clense_ISO8601($_a->{end}) );
+                        $after = $_dt_parser->parse_datetime( cleanse_ISO8601($_a->{end}) );
                     }
-                    $end = clense_ISO8601($after->strftime('%FT%T%z'));
+                    $end = cleanse_ISO8601($after->strftime('%FT%T%z'));
                 }
             }
 
index 7b8a939..e397564 100644 (file)
@@ -84,7 +84,7 @@ sub create_active_events_for_object {
 
             if (my $dfield = $def->delay_field) {
                 if ($target->$dfield()) {
-                    $date = DateTime::Format::ISO8601->new->parse_datetime( clense_ISO8601($target->$dfield) );
+                    $date = DateTime::Format::ISO8601->new->parse_datetime( cleanse_ISO8601($target->$dfield) );
                 } else {
                     next;
                 }
@@ -170,7 +170,7 @@ sub create_event_for_object_and_def {
 
             if (my $dfield = $def->delay_field) {
                 if ($target->$dfield()) {
-                    $date = DateTime::Format::ISO8601->new->parse_datetime( clense_ISO8601($target->$dfield) );
+                    $date = DateTime::Format::ISO8601->new->parse_datetime( cleanse_ISO8601($target->$dfield) );
                 } else {
                     next;
                 }
index aa93eb1..222b002 100644 (file)
@@ -22,7 +22,7 @@ my $_TT_helpers = {
     # turns a date into something TT can understand
     format_date => sub {
         my $date = shift;
-        $date = DateTime::Format::ISO8601->new->parse_datetime(clense_ISO8601($date));
+        $date = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($date));
         return sprintf(
             "%0.2d:%0.2d:%0.2d %0.2d-%0.2d-%0.4d",
             $date->hour,
index 6c94702..2f35feb 100644 (file)
@@ -29,7 +29,7 @@ sub MinPassiveTargetAge {
     my $target = $env->{target};
     my $delay_field = $env->{params}->{target_age_field} || $env->{event}->event_def->delay_field;
 
-    my $delay_field_ts = DateTime::Format::ISO8601->new->parse_datetime(clense_ISO8601($target->$delay_field()));
+    my $delay_field_ts = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($target->$delay_field()));
 
     # to get the minimum time that the target must have aged to, add the min age to the delay field
     $delay_field_ts->add( seconds => interval_to_seconds( $env->{params}->{min_target_age} ) );
@@ -51,7 +51,7 @@ sub CircIsOverdue {
         return 0 if (!$self->MinPassiveTargetAge($env));
     }
 
-    my $due_date = DateTime::Format::ISO8601->new->parse_datetime(clense_ISO8601($circ->due_date));
+    my $due_date = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($circ->due_date));
     return 0 if $due_date > DateTime->now;
 
     return 1;
index 1bc9a36..855d386 100644 (file)
@@ -158,7 +158,7 @@ sub format_date {
        return "" unless $date;
 
        $date = DateTime::Format::ISO8601->new->
-               parse_datetime(OpenSRF::Utils::clense_ISO8601($date));
+               parse_datetime(OpenSRF::Utils::cleanse_ISO8601($date));
        my @time = localtime($date->epoch);
 
        my $year = $time[5]+1900;
index 933ec17..b1f9fc9 100644 (file)
@@ -236,7 +236,7 @@ sub screen_msg {
        }
 
        my $expire = DateTime::Format::ISO8601->new->parse_datetime(
-               clense_ISO8601($u->expire_date));
+               cleanse_ISO8601($u->expire_date));
 
        return $b if CORE::time > $expire->epoch;
 
index d385fb9..0dc2ef4 100644 (file)
@@ -165,7 +165,7 @@ sub check_age_protect {
        # Now, now many seconds old is this copy
        my $create_date = DateTime::Format::ISO8601
                ->new
-               ->parse_datetime( OpenSRF::Utils::clense_ISO8601($copy->create_date) )
+               ->parse_datetime( OpenSRF::Utils::cleanse_ISO8601($copy->create_date) )
                ->epoch;
 
        my $age = time - $create_date;
index 71ced48..30a7c89 100644 (file)
@@ -1312,7 +1312,7 @@ sub create_record_feed {
                }
 
                $node->id($item_tag);
-               #$node->update_ts(clense_ISO8601($record->edit_date));
+               #$node->update_ts(cleanse_ISO8601($record->edit_date));
                $node->link(alternate => $feed->unapi . "?id=$item_tag&format=htmlholdings-full" => 'text/html') if ($flesh);
                $node->link(opac => $feed->unapi . "?id=$item_tag&format=opac") if ($flesh);
                $node->link(unapi => $feed->unapi . "?id=$item_tag") if ($flesh);
index c1a91ad..998cc22 100755 (executable)
@@ -328,7 +328,7 @@ sub get_bib_attr {
 # provides a date that Template::Plugin::Date can parse
 sub parse_due_date {
     my $circ = shift;
-    my $due = DateTime::Format::ISO8601->new->parse_datetime(clense_ISO8601($circ->due_date));
+    my $due = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($circ->due_date));
     return sprintf(
         "%0.2d:%0.2d:%0.2d %0.2d-%0.2d-%0.4d",
         $due->hour,