fix ticket display, fallout from #17067
authorMark Wells <mark@freeside.biz>
Tue, 30 Oct 2012 19:16:13 +0000 (12:16 -0700)
committerMark Wells <mark@freeside.biz>
Tue, 30 Oct 2012 19:16:13 +0000 (12:16 -0700)
FS/FS/Misc/DateTime.pm
httemplate/elements/table-tickets.html

index e36f3a9..9c12e64 100644 (file)
@@ -32,13 +32,14 @@ the date as an integer UNIX timestamp.
 sub parse_datetime {
   my $string = shift;
   return '' unless $string =~ /\S/;
+  my $tz = shift || 'local';
 
   my $conf = new FS::Conf;
   my $format = $conf->config('date_format') || '%m/%d/%Y';
 
   if ( $format eq '%d/%m/%Y' ) { #  =~ /\%d.*\%m/ ) {
     #$format =~ s/\%//g;
-    my $parser = DateTime::Format::Natural->new( 'time_zone' => 'local',
+    my $parser = DateTime::Format::Natural->new( 'time_zone' => $tz,
                                                  #'format'=>'d/m/y',#lc($format)
                                                );
     $dt = $parser->parse_datetime($string);
@@ -51,7 +52,7 @@ sub parse_datetime {
       $dt->epoch;
     }
   } else {
-    return str2time($string);
+    return str2time($string, $tz);
   }
   
 }
index ffcaf06..f89f984 100644 (file)
@@ -153,7 +153,7 @@ if ( $ss_priority ) {
 my $format = $conf->config('date_format') || '%Y-%m-%d';
 
 my $date_formatter = sub {
-  my $time = str2time($_[0], 'GMT');
+  my $time = parse_datetime($_[0], 'GMT');
   # exclude times within 24 hours of zero
   ($time > 86400) ? time2str($format, $time) : '';
 };