Fix regression in date formatting for purposes other than due dates
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Jun 2010 19:05:07 +0000 (19:05 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Jun 2010 19:05:07 +0000 (19:05 +0000)
Thanks to #atheos in IRC for pointing out this problem

git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6_0@16547 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/SIP.pm

index 44435f3..20fcaa0 100644 (file)
@@ -168,11 +168,11 @@ sub format_date {
        my $minute = $time[1];
        my $second = $time[0];
   
-       $date = sprintf("%04d-%02d-%02d", $year, $mon, $day);
-  
-       # Due dates need time of day as well
+       $date = sprintf("%04d%02d%02d", $year, $mon, $day);
+
+       # Due dates need hyphen separators and time of day as well
        if ($type eq 'due') {
-               $date .= sprintf(" %02d:%02d:%02d", $hour, $minute, $second);
+               $date = sprintf("%04d-%02d-%02d %02d:%02d:%02d", $year, $mon, $day, $hour, $minute, $second);
        }
 
        syslog('LOG_DEBUG', "OILS: formatted date [type=$type]: $date");