Commit 25f6509f authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 369912: Buglists exported as iCalendar have wrong timestamps - Patch by…

Bug 369912: Buglists exported as iCalendar have wrong timestamps - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=myk a=LpSolit
parent be11b7c3
...@@ -1018,13 +1018,13 @@ while (my @row = $buglist_sth->fetchrow_array()) { ...@@ -1018,13 +1018,13 @@ while (my @row = $buglist_sth->fetchrow_array()) {
# Put in the change date as a time, so that the template date plugin # Put in the change date as a time, so that the template date plugin
# can format the date in any way needed by the template. ICS and Atom # can format the date in any way needed by the template. ICS and Atom
# have specific, and different, date and time formatting. # have specific, and different, date and time formatting.
$bug->{'changedtime'} = str2time($bug->{'changeddate'}); $bug->{'changedtime'} = str2time($bug->{'changeddate'}, Bugzilla->params->{'timezone'});
$bug->{'changeddate'} = DiffDate($bug->{'changeddate'}); $bug->{'changeddate'} = DiffDate($bug->{'changeddate'});
} }
if ($bug->{'opendate'}) { if ($bug->{'opendate'}) {
# Put in the open date as a time for the template date plugin. # Put in the open date as a time for the template date plugin.
$bug->{'opentime'} = str2time($bug->{'opendate'}); $bug->{'opentime'} = str2time($bug->{'opendate'}, Bugzilla->params->{'timezone'});
$bug->{'opendate'} = DiffDate($bug->{'opendate'}); $bug->{'opendate'} = DiffDate($bug->{'opendate'});
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
# #
# Contributor(s): William Jon McCann <mccann@jhu.edu> # Contributor(s): William Jon McCann <mccann@jhu.edu>
#%] #%]
[% PROCESS global/variables.none.tmpl %][% USE date %] [% PROCESS global/variables.none.tmpl %]
BEGIN:VCALENDAR BEGIN:VCALENDAR
CALSCALE:GREGORIAN CALSCALE:GREGORIAN
[%+ PROCESS ics_prodid +%] [%+ PROCESS ics_prodid +%]
...@@ -32,7 +32,7 @@ BEGIN:VTODO ...@@ -32,7 +32,7 @@ BEGIN:VTODO
[%+ PROCESS ics_status bug_status = bug.bug_status +%] [%+ PROCESS ics_status bug_status = bug.bug_status +%]
[%+ PROCESS ics_dtstamp +%] [%+ PROCESS ics_dtstamp +%]
[% IF bug.changeddate %] [% IF bug.changeddate %]
[%+ date.format(bug.changedtime,"%Y%m%dT%H%M%SZ") FILTER ics('LAST-MODIFIED') +%] [%+ time2str("%Y%m%dT%H%M%SZ", bug.changedtime, "UTC") FILTER ics('LAST-MODIFIED') +%]
[% END %] [% END %]
[% IF bug.percentage_complete %] [% IF bug.percentage_complete %]
[%+ bug.percentage_complete FILTER format('%d') FILTER ics('PERCENT-COMPLETE') +%] [%+ bug.percentage_complete FILTER format('%d') FILTER ics('PERCENT-COMPLETE') +%]
...@@ -66,11 +66,11 @@ END:VCALENDAR ...@@ -66,11 +66,11 @@ END:VCALENDAR
[% END %] [% END %]
[% BLOCK ics_dtstart %] [% BLOCK ics_dtstart %]
[% date.format(bug.opentime,"%Y%m%dT%H%M%SZ") FILTER ics('DTSTART') %] [% time2str("%Y%m%dT%H%M%SZ", bug.opentime, "UTC") FILTER ics('DTSTART') %]
[% END %] [% END %]
[% BLOCK ics_dtstamp %] [% BLOCK ics_dtstamp %]
[% date.format(date.now,"%Y%m%dT%H%M%SZ") FILTER ics('DTSTAMP') %] [% time2str("%Y%m%dT%H%M%SZ", currenttime, "UTC") FILTER ics('DTSTAMP') %]
[% END %] [% END %]
[% BLOCK ics_status %] [% BLOCK ics_status %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment