MyBB Community Forums

Full Version: Setting startday of the week on Calendar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

How can I set the startday of the week "Monday" on calendar?

Thank you.
Open ./calendar.php

FInd

$sblanks = date("w", $time);

replace with
$sblanks = date("w", $time)-1;

Now go to the calendar template


find

<td class="thead" width="14%" align="center">{$lang->sunday}</td>
			<td class="thead" width="14%" align="center">{$lang->monday}</td>
			<td class="thead" width="14%" align="center">{$lang->tuesday}</td>
			<td class="thead" width="14%" align="center">{$lang->wednesday}</td>
			<td class="thead" width="14%" align="center">{$lang->thursday}</td>
			<td class="thead" width="14%" align="center">{$lang->friday}</td>
			<td class="thead" width="14%" align="center">{$lang->saturday}</td>

and reorder them starting by monday ending with sunday.


but let me add WHAT A REQUEST
regards
zaher1988 Wrote:Open ./calendar.php

FInd

$sblanks = date("w", $time);

replace with
$sblanks = date("w", $time)-1;

Now go to the calendar template


find

<td class="thead" width="14%" align="center">{$lang->sunday}</td>
			<td class="thead" width="14%" align="center">{$lang->monday}</td>
			<td class="thead" width="14%" align="center">{$lang->tuesday}</td>
			<td class="thead" width="14%" align="center">{$lang->wednesday}</td>
			<td class="thead" width="14%" align="center">{$lang->thursday}</td>
			<td class="thead" width="14%" align="center">{$lang->friday}</td>
			<td class="thead" width="14%" align="center">{$lang->saturday}</td>

and reorder them starting by monday ending with sunday.


but let me add WHAT A REQUEST
regards

Thank you but there are problems.
There are two problems with April and July months.
I send attached images to show problems:

[attachment=5503]
[attachment=5504]
Alright below

$sblanks = date("w", $time)-1;

Put
	if($sblanks == -1)
	{
		$sblanks = 6;
	}
zaher1988 Wrote:but let me add WHAT A REQUEST
regards

You do realize the majority of people start their week on Monday?
OH well.. there is a big debate as you know about the first day of the week, usually it is know to be sunday, but you start work on monday.

WIKIPEDIA Wrote:In many countries, including, most of Europe, Asia, and South America, Monday is held to be the first day of the week. In others, including the United States, Canada, and in parts of Africa, Sunday is seen as the first day, a traditional view derived from the Jewish language via Ecclesiastical Latin. ISO 8601 defines Monday as the first day of the week, making Sunday the seventh.

According to the Bible, God created the Earth in six days, and rested on the seventh day, the Sabbath, i.e. Saturday. This made Sunday the first day of the week, while Saturdays were reserved for celebration and rest. After the week was adopted in Early Christian Europe, Sunday remained the first day of the week, but also gradually displaced Saturday as the day of celebration and rest, being considered the Lord's Day. In some places Sunday thus came to be viewed as the last day of the week.
More info http://en.wikipedia.org/wiki/Days_of_the_week Toungue

Back to the techincal work now...
Works great!
Thank you zaher1988.
I have to disagree with Wikipedia. In Portuguese, only Sunday and Saturday have proper names (Domingo and Sábado - all the other days are referenced by number - Segunda (Second = Monday) through Sexta (Sixth = Friday). If the week were to start on Monday, all their names would be off by one.
I found another problem.

There's a birthday in my forum in July 31st.
[attachment=6472]

If I click on the birthday, it takes me to the events on the previous day.
[attachment=6473]