]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 486006 - importxml.pl must not use format_time() for deadlines
authorghendricks%novell.com <>
Fri, 10 Apr 2009 22:28:43 +0000 (22:28 +0000)
committerghendricks%novell.com <>
Fri, 10 Apr 2009 22:28:43 +0000 (22:28 +0000)
 patch by ghendricks r=LpSolit a=LpSolit

Bugzilla/Util.pm
importxml.pl

index 7ed20c87521622b67511afcb9828ade98ef284b4..a725a8e21f38f7f8d70b2dfed3a6231e71788cde 100644 (file)
@@ -445,8 +445,10 @@ sub format_time {
                                 hour   => $time[2],
                                 minute => $time[1],
                                 second => $time[0],
-                                # Use the timezone specified by the server.
-                                time_zone => Bugzilla->local_timezone});
+                                # If importing, use the specified timezone, otherwise 
+                                # use the timezone specified by the server.
+                                time_zone => Bugzilla->local_timezone->offset_as_string($time[6]) 
+                                          || Bugzilla->local_timezone});
 
         # Now display the date using the given timezone,
         # or the user's timezone if none is given.
index 0a6aefe45b587305d7fc668ba5924806380f4fa6..bd4aee186ce10c45ac4c4acf985d38b29c8d4429 100755 (executable)
@@ -87,7 +87,6 @@ use Bugzilla::Status;
 
 use MIME::Base64;
 use MIME::Parser;
-use Date::Format;
 use Getopt::Long;
 use Pod::Usage;
 use XML::Twig;
@@ -803,8 +802,7 @@ sub process_bug {
 
     # Process time fields
     if ( $params->{"timetrackinggroup"} ) {
-        my $date = format_time( $bug_fields{'deadline'}, "%Y-%m-%d" )
-          || undef;
+        my $date = validate_date( $bug_fields{'deadline'} ) ? $bug_fields{'deadline'} : undef;
         push( @values, $date );
         push( @query,  "deadline" );
         if ( defined $bug_fields{'estimated_time'} ) {