CMS MADE SIMPLE FORGE

CGCalendar

 

[#12403] display="weeklist" can fail on week 53

avatar
Created By: Jon Radermacher (jraderma)
Date Submitted: Sat Jan 02 17:55:27 -0500 2021

Assigned To: Robert Campbell (calguy1000)
Version: 2.6.2
CMSMS Version: 2.2.15
Severity: Minor
Resolution: None
State: Open
Summary:
display="weeklist" can fail on week 53
Detailed Description:
action.list.php can calculate $start_ts and $end_ts incorrectly for week 53.
Without an exception cooked into the if statement for case 'week': starting on
line 99, the strtotime functions on line 124 and 125 can produce the incorrect
timestamp when any days from week 53 fall into the newest year.

I write this report on Jan 2, 2021. On line 124, $start_ts get calculated with
the values 2021, 53, 1 and on line 125, $end_ts get calculated with values 2021,
53, 7. After each go through the formatting string (from line 120), they end up
as follows:

2021-W53-1 (timestamp 1641189600)
     &
2021-W53-7 (timestamp 1641794399)

Naturally, both times stamps are one year too far ahead. It appears this will
only happen when a new year starts in week 53.


History