Setting the Calendar Start Day

By default, the calendar displays the Sunday as the first day of the week. You can of course change this using the setStartDay function.

The setStartDay function takes a single argument which defines the day to start the week on. The values for each day are shown here in the table

Here's an example to show how to set Monday as the first day of the week:

<? $cal = new Calendar; $cal->setStartDay(1); echo $cal->getCurrentMonthView(); ?>

This should give you a calendar as follows:

  June 2018  
M T W T F S S
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  

 

Back to the Calendar page