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 48
48
<?php foreach (get_eol_branches () as $ major => $ branches ): ?>
49
49
<?php foreach ($ branches as $ branch => $ detail ): ?>
50
50
<?php $ eolDate = get_branch_security_eol_date ($ branch ) ?>
51
- <?php $ eolPeriod = format_interval ($ eolDate , null ) ?>
51
+ <?php $ eolPeriod = format_interval ($ eolDate , new DateTime ( ' now ' ) ) ?>
52
52
<tr>
53
53
<td><?php echo htmlspecialchars ($ branch ); ?> </td>
54
54
<td>
Original file line number Diff line number Diff line change @@ -43,11 +43,10 @@ $BRANCHES = [
43
43
* page. (Currently 28 days.) */
44
44
$ KEEP_EOL = new DateInterval ('P28D ' );
45
45
46
- function format_interval ($ from , $ to ) {
46
+ function format_interval ($ from , DateTime $ to ) {
47
47
try {
48
48
$ 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 );
51
50
52
51
$ times = [];
53
52
if ($ diff ->y ) {
Original file line number Diff line number Diff line change 54
54
$ initial = get_branch_release_date ($ branch );
55
55
$ until = get_branch_bug_eol_date ($ branch );
56
56
$ eol = get_branch_security_eol_date ($ branch );
57
+ $ now = new DateTime ('now ' );
57
58
?>
58
59
<tr class="<?php echo $ state ?> ">
59
60
<td>
63
64
<?php endif ?>
64
65
</td>
65
66
<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>
67
68
<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>
69
70
<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>
71
72
</tr>
72
73
<?php endforeach ?>
73
74
<?php endforeach ?>
You can’t perform that action at this time.
0 commit comments