Make WordPress Core

Opened 4 weeks ago

Last modified 4 weeks ago

#54132 new defect (bug)

Function calendar_week_mod should depends on week_begins

Reported by: voregnev Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: reporter-feedback
Focuses: Cc:


When we use get_calendar() - its generate wrong weeks breaks, because ancient function calendar_week_mod not depends on start day of week variable.

Change History (1)

#1 @sabernhardt
4 weeks ago

  • Keywords reporter-feedback added

Hi and welcome to Trac!

The $week_begins variable is used for all three calendar_week_mod calculations within the get_calendar function:

$pad = calendar_week_mod( gmdate( 'w', $unixmonth ) - $week_begins );
if ( 6 == calendar_week_mod( gmdate( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins ) ) {
$pad = 7 - calendar_week_mod( gmdate( 'w', mktime( 0, 0, 0, $thismonth, $day, $thisyear ) ) - $week_begins );

So I think the problem could be somewhere else. I did not have trouble changing the week's start day with the Calendar widget.

  • Is a plugin active that might edit the calendar output with the get_calendar filter?
  • Do you have the get_calendar directly in a theme template file (or a plugin)?
  • Could you upload a screenshot or add other details?
Last edited 4 weeks ago by sabernhardt (previous) (diff)
Note: See TracTickets for help on using tickets.