Fixed error in date handling.
authorAndrew DeFaria <Andrew@DeFaria.com>
Sun, 5 Nov 2017 03:13:07 +0000 (20:13 -0700)
committerAndrew DeFaria <Andrew@DeFaria.com>
Sun, 5 Nov 2017 03:13:07 +0000 (20:13 -0700)
maps/bin/MAPSUtil.pm

index 2298d77..e28a9d6 100644 (file)
@@ -33,9 +33,9 @@ sub Today2SQLDatetime;
 sub FormatDate {
   my ($date) = @_;
 
-  return substr $date, 5, 2  . '/' .
-         substr $date, 8, 2  . '/' .
-         substr $date, 0, 4;
+  return substr ($date, 5, 2)  . '/' .
+         substr ($date, 8, 2)  . '/' .
+         substr ($date, 0, 4);
 } # FormatDate
 
 sub FormatTime {
@@ -141,9 +141,9 @@ sub SubtractDays {
     $month = '0' . $month;
   } # if
 
-  # Prefix days with  0 if necessary
-  if ($days eq 0) { 
-      $days = '01';
+  # Prefix days with 0 if necessary
+  if ($days == 0) { 
+     $days = '01';
   } elsif ($days < 10) {
     $days = '0' . $days;
   } # if