[wp-trac] [WordPress Trac] #54132: Function calendar_week_mod should depends on week_begins

WordPress Trac noreply at wordpress.org
Sat Sep 18 05:43:21 UTC 2021


#54132: Function calendar_week_mod should depends on week_begins
-------------------------------+------------------------------
 Reporter:  voregnev           |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by sabernhardt):

 * keywords:   => reporter-feedback


Comment:

 Hi and welcome to Trac!

 The `$week_begins` variable is used for all three `calendar_week_mod`
 [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/general-
 template.php?rev=51768#L2327 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?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54132#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list