File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 4848 <?php foreach (get_eol_branches () as $ major => $ branches ): ?>
4949 <?php foreach ($ branches as $ branch => $ detail ): ?>
5050 <?php $ eolDate = get_branch_security_eol_date ($ branch ) ?>
51- <?php $ eolPeriod = format_interval ($ eolDate , null ) ?>
51+ <?php $ eolPeriod = format_interval ($ eolDate , new DateTime ( ' now ' ) ) ?>
5252 <tr>
5353 <td><?php echo htmlspecialchars ($ branch ); ?> </td>
5454 <td>
Original file line number Diff line number Diff line change @@ -43,11 +43,10 @@ $BRANCHES = [
4343 * page. (Currently 28 days.) */
4444$ KEEP_EOL = new DateInterval ('P28D ' );
4545
46- function format_interval ($ from , $ to ) {
46+ function format_interval ($ from , DateTime $ to ) {
4747 try {
4848 $ from_obj = $ from instanceof DateTime ? $ from : new DateTime ($ from );
49- $ to_obj = $ to instanceof DateTime ? $ to : new DateTime ($ to );
50- $ diff = $ to_obj ->diff ($ from_obj );
49+ $ diff = $ to ->diff ($ from_obj );
5150
5251 $ times = [];
5352 if ($ diff ->y ) {
Original file line number Diff line number Diff line change 5454 $ initial = get_branch_release_date ($ branch );
5555 $ until = get_branch_bug_eol_date ($ branch );
5656 $ eol = get_branch_security_eol_date ($ branch );
57+ $ now = new DateTime ('now ' );
5758 ?>
5859 <tr class="<?php echo $ state ?> ">
5960 <td>
6364 <?php endif ?>
6465 </td>
6566 <td><?php echo htmlspecialchars ($ initial ->format ('j M Y ' )) ?> </td>
66- <td class="collapse-phone"><em><?php echo htmlspecialchars (format_interval ($ initial , null )) ?> </em></td>
67+ <td class="collapse-phone"><em><?php echo htmlspecialchars (format_interval ($ initial , $ now )) ?> </em></td>
6768 <td><?php echo htmlspecialchars ($ until ->format ('j M Y ' )) ?> </td>
68- <td class="collapse-phone"><em><?php echo htmlspecialchars (format_interval ($ until , null )) ?> </em></td>
69+ <td class="collapse-phone"><em><?php echo htmlspecialchars (format_interval ($ until , $ now )) ?> </em></td>
6970 <td><?php echo htmlspecialchars ($ eol ->format ('j M Y ' )) ?> </td>
70- <td class="collapse-phone"><em><?php echo htmlspecialchars (format_interval ($ eol , null )) ?> </em></td>
71+ <td class="collapse-phone"><em><?php echo htmlspecialchars (format_interval ($ eol , $ now )) ?> </em></td>
7172 </tr>
7273 <?php endforeach ?>
7374 <?php endforeach ?>
You can’t perform that action at this time.
0 commit comments