You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getBeginWeek() / getEndWeek() always see Sunday: Format('%w') returns "w" #520
getBeginWeek() and getEndWeek() (includes/cleanup_functions.php ~L925–945, used by weekDates(), weekCells() and displayWeeks() and their _r variants for the tasks-per-user report) read the weekday with $d->Format('%w').
w2p_Utilities_Date::format() has no %w (#519), so it returns the string "w", (int) "w" is 0, and both functions treat every date as a Sunday:
getBeginWeek() therefore returns the date's own week instead of the week of the Sunday on or before it: for Wednesday 2026-10-21 it returns 43, while the Sunday before (2026-10-18) is in week 42. getEndWeek() happens to give the right week, because the Saturday after a date is in the same ISO week. The report's first week column can be off by one.
Fix: use (int) $d->getDayOfWeek() instead of Format('%w'). Also check what the report expects. %U maps to date('W') (ISO, Monday-start weeks), but these functions step to Sunday/Saturday, so the week numbering is mixed either way.
Activity
getBeginWeek()/getEndWeek(): return the ISO week of the date