[open-ils-commits] r16547 - branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Jun 1 15:05:11 EDT 2010


Author: dbs
Date: 2010-06-01 15:05:07 -0400 (Tue, 01 Jun 2010)
New Revision: 16547

Modified:
   branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/SIP.pm
Log:
Fix regression in date formatting for purposes other than due dates

Thanks to #atheos in IRC for pointing out this problem


Modified: branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/SIP.pm
===================================================================
--- branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/SIP.pm	2010-06-01 19:02:19 UTC (rev 16546)
+++ branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/SIP.pm	2010-06-01 19:05:07 UTC (rev 16547)
@@ -168,11 +168,11 @@
  	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");



More information about the open-ils-commits mailing list