]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1540715 - Fix offset of historical dates in secbugs report
authorIsrael Madueme <purelogiq@gmail.com>
Wed, 15 May 2019 16:03:31 +0000 (12:03 -0400)
committerDylan William Hardison <dylan@hardison.net>
Wed, 15 May 2019 16:03:31 +0000 (12:03 -0400)
`FILTER time` from Bugzilla's template helpers was inconsistent on
how it rendered the dates of the columns (due to different system
timezones that change based on where the code is being run).

This patch sets the expected timezone for the report and manually
formats the time (since FILTER time seems to not respect the date's
timezone).

template/en/default/reports/email/security-risk.html.tmpl

index 45d5c11b001f89c49ca6c0804c97ceb028fe0a85..90e335f4665e79a6001fc110b498ab96f1d48e23 100644 (file)
@@ -21,7 +21,7 @@
   <tr>
     <th style="padding: 0px 15px 10px 0px;">Team</th>
     <th style="padding: 0px 15px 10px 0px; text-align: right;">
-        Open<br>[% results.reverse.0.date FILTER time('%m/%d') %]
+        Open<br>[% results.reverse.0.date.strftime('%m/%d') FILTER html %]
     </th>
     <th style="padding: 0px 15px 10px 0px; text-align: right;">Closed<br />Last Week</th>
     <th style="padding: 0px 15px 10px 0px; text-align: right; border-right: 1px solid grey;">Added<br />Last Week</th>
@@ -29,7 +29,7 @@
       [% NEXT IF loop.count < 2 %]
       [% LAST IF loop.count > 4 %]
       <th style="padding: 0px 15px 10px [% IF loop.count == 2 %] 10px [% ELSE %] 0px [% END %]; text-align: right; [% IF loop.count == 1 %] border-right: 1px solid grey; [% END %]">
-        Open<br>[% result.date FILTER time('%m/%d') %]
+        Open<br>[% result.date.strftime('%m/%d') FILTER html %]
       </th>
     [% END %]
   </tr>
@@ -89,7 +89,7 @@
   <tr>
     <th style="padding: 0px 15px 10px 0px;">Category</th>
     <th style="padding: 0px 15px 10px 0px; text-align: right;">
-        Open<br>[% results.reverse.0.date FILTER time('%m/%d') %]
+        Open<br>[% results.reverse.0.date.strftime('%m/%d') FILTER html %]
     </th>
     <th style="padding: 0px 15px 10px 0px; text-align: right;">Closed<br />Last Week</th>
     <th style="padding: 0px 15px 10px 0px; text-align: right;">Added<br />Last Week</th>
       [% NEXT IF loop.count < 2 %]
       [% LAST IF loop.count > 4 %]
       <th style="padding: 0px 15px 10px [% IF loop.count == 2 %] 10px [% ELSE %] 0px [% END %]; text-align: right;  [% IF loop.count == 1 %] border-right: 1px solid grey; [% END %]">
-        Open<br>[% result.date FILTER time('%m/%d') %]
+        Open<br>[% result.date.strftime('%m/%d') FILTER html %]
       </th>
     [% END %]
   </tr>