Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#32 closed defect (bug) (fixed)

Calendar makes no use of option "start_of_week"

Reported by: anonymousbugger Owned by: ryan
Milestone: Priority: normal
Severity: trivial Version:
Component: General Keywords:
Focuses: Cc:


In Wordpress 1.0 an option existed to switch the start of the week (monday or sunday). However the calendar always ignored this setting. In Wordpress 1.2 the option only exists in the database, has vanished from the options-page and the calendar still ignores it.

Attachments (3)

0000032-template-functions-general.diff (2.1 KB) - added by anonymousbugger 15 years ago.
0000032-template-functions-general.diff.2.gz (883 bytes) - added by anonymousbugger 15 years ago.
0000032-template-functions-general.diff.gz (883 bytes) - added by anonymousbugger 15 years ago.

Download all attachments as: .zip

Change History (22)

#2 @michel v
16 years ago

That functionnality will be moved to the localisation file.
If there is a reason for it not to be tied to localisation files, please bring it (we can't claim knowledge of every culture's start of week).

#3 @michel v
16 years ago

  • Status changed from new to assigned

#4 @anonymousbugger
16 years ago

What do you mean by "functionality"? The option/setting or the whole get_calendar function? The bug i was trying to point out is the fact that get_calendar silently ignores existing settings (even if they are from previous versions, but they are there and should be used, shouldn't they?)

#5 @JasonV
16 years ago

I'm not sure it should be in the localisation files. Or at least, not only there. Perhaps the localisation files should provide a default which can be overridden with a setting in the DB.

#6 @rq
16 years ago

Attaching a patch for 1.2-epsilon-RC2 (which became 1.2-final next day) that makes calendar use the "start_of_the week" variable. Any testers? For me it does work, but it would be nice if anyone else would test it.

The patch was previously posted to the forums. It's not related to the sebbi.de one.

edited on: 06-16-04 18:11

edited on: 06-16-04 18:11

#7 @Sebbi
16 years ago

I tested your patch, rq. It seemed to work, but there is the possibility that negative padding can occur. Unfortuneatly I have seen your patch _after_ i wrote my own (which worked, btw, in 1.0, too) ... i just could not live with the fact that my week should start sundays ... that is definetly too early :-)

#8 @rq
16 years ago

It also works for me.
In forums, there was also a comment about positive negative padding, but I don't think it CAN occur (unless someone proves i'm wrong).

the following function is used for padding, and it ALWAYS returns a positive value:

this one is used in get_calendar
function mod($num, $base) {

return ($num - $base*floor($num/$base));


So, I think, it's OK.

cunsidering the localization - i'd say that the _default_ start_of_the_week should be localized, and maybe it shouldn't even go to settings at all. However, I believe this is not the scope of this bug ("Calendar does _not_ use the setting at all").

#9 @rq
16 years ago

so is it fixed in CVS?

#10 @Anne
16 years ago

Probably not, this bug hasn't been assigned yet.

#11 @rq
16 years ago

Why not? We do have a patch, and yet noone can take care of applying it?..

#12 @Sebbi
16 years ago


No it is not fixed in cvs ... come on, it should be easy enough and you would make us non-american wordpress-users very happy if we don't have to apply our own patches to the next release :-)

#13 @anonymousbugger
16 years ago

oh please please please...

This is probably the only bug, patch of witch keeps me with 1.2-epsilon now ;/

#14 @anonymousbugger
16 years ago

Meanwhile ... template-functions-general.php moved from version 1.35 to version 1.38 ... and no fix for that bug ... the wordpress-sphere still starts its week on sunday. Imagine! Starting on sunday would make sunday the ultimate evil (day) of the week ... monday is supposed to have this meaning (at least in Europe) ... so let us have that day as first day of the worker-slave's week ... please!!! :-)

#15 @rq
16 years ago

dear developers,
is it so darn hard to apply a little diff??????


#16 @rq
16 years ago

I found out that the patch doesn't work with the CVS version of files.
in fact, it seems like either the server or me makes the file unpatchable at all w/o modifications.
So in the next few days (i'll be away tomorrow and on sunday), I'll make another diff and put it here in a gzipped form. I HOPE that WILL go into the CVS.

#17 @rq
16 years ago

Attached a new gzipped diff against quite fresh CVS. This one should really work. Please patch the upstream with it, and let's squash this bug!

edited on: 07-25-04 18:09

#18 @rq
16 years ago

updated patch uploaded

#19 @ryan
16 years ago

  • Owner changed from anonymous to rboren

#20 @ryan
16 years ago

  • Resolution changed from 10 to 20
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.