The week start setting has no effect on the calendar. There may be a locale setting in PHP you can change to have it use the correct days, but a sure way to be able to change it is to edit template-functions.php under get_calenday().
I had the same problem (in Hebrew), so this is my solution:
1. in wp-config-extra.php, build another array like this one:
$shortweekday[0]='א';
$shortweekday[1]='ב';
$shortweekday[2]='ג';
$shortweekday[3]='ד';
$shortweekday[4]='ה';
$shortweekday[5]='ו';
$shortweekday[6]='ש';
2. copy function get_calendar($daylength = 1) from template-functions.php (WP1.01) or template-functions-general.php (WP1.1) to my-hacks.php and rename it: my_get_calendar($daylength = 1) so you don’t have to change it when you upgrade.
3. In this function, change any $weekday (2 times, inc. the global declaration) to $shortweekday.
That’s all.
Great instructions Anavy.
thanks allusion. Can you consider adding this method to the Calendar function with a flag for choosing between $weekday and $shortweekday ?
Anonymous
You need to change the pre and post padding to different values. Just look for the according places in the get_calendar() function and change to this:
[pre padding]
// See how much we should pad in the beginning
$pad = intval(date(‘w’, $unixmonth));
$pad = $pad + 6 % 7;
if (0 != $pad) echo “\n\t\t<td colspan=’$pad’ class=’pad’> </td>”;
[post padding]
$foo = (date(‘w’, mktime(0, 0 , 0, $thismonth, $day, $thisyear))+6)%7;
if ($foo != 0)
$pad = 7 – $foo;
else
$pad = $foo;
if (0 != $pad)
echo “\n\t\t<td class=’pad’ colspan=’$pad’> </td>”;
Maybe it’s possible to do this more elegantly, but this one works. You can see it here
HTH
smo
ups. You’re right. I forgot something. in the same function look for the line that says
if (6 == date(‘w’, mktime(0, 0 , 0, $thismonth, $day, $thisyear)))
Change the 6 to 0 and you’re set.
🙂
HTH
smo
Thank you. Now it works. 🙂
jbygden, citizenx:
please change to pre padding part to:
$pad = ($pad + 6) % 7;
Unfortunatly I forgot that % (the modulo operator) binds much stronger than the addition (+). So we have to put the addition in parenthesis. Now it should work.
WordPress rules! 🙂
smo
Thanx smo,
That did the trick.
To allusion (or any other admin/developer that might read this), the week doesn’t start Sunday in all parts of the world so this might be something to look at taking care of in the next release?
Note for the newbies wasting their time with a messed up calendar (yes, I have to admit I did…)
First of all you have to modify the starting day (default Sunday) in your wp-config-extra.php file, $weekday[0]=’Monday’ instead of ‘Sunday’ then and keep the list logical. BTW, it’s the same process if you translate.
Once done this mod will work smoothly 🙂
Thank you smo 🙂