DHTMLX Docs & Samples Explorer

Changing week start day

This sample illustrates that you can control the start day of week by using 'weekstart' property.

Week starts with MondayWeek starts with Sunday

Also, starting day for the week can be defined in overal language settings:
Source
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxcalendar.css">
<script>
window.dhx_globalImgPath = "../../codebase/imgs/";
</script> <script src="../../codebase/dhtmlxcommon.js"></script> <script src="../../codebase/dhtmlxcalendar.js"></script> <script>
var cal1,
cal2,
mCal,
mDCal,
newStyleSheet;
var dateFrom = null;
var dateTo = null;
 
window.onload = function() {
    mCal = new dhtmlxCalendarObject('dhtmlxCalendar1', false, {
        isYearEditable: true
    });
    mCal.setYearsRange(2000, 2500);
    mCal.draw();
    mCal1 = new dhtmlxCalendarObject('dhtmlxCalendar2', false, {
        isYearEditable: true
    });
    mCal1.setYearsRange(2000, 2500);
    mCal1.loadUserLanguage('en-us');
    mCal1.options.weekstart = 1;
    mCal1.draw();
}
</script> <p> This sample illustrates that you can control the start day of week by using 'weekstart' property. <table cellpadding="5"> <tr> <td>Week starts with Monday</td><td>Week starts with Sunday</td></tr> <tr> <td valign="top"><div id="dhtmlxCalendar2"></div></td> <td valign="top"><div id="dhtmlxCalendar1"></div></td> </tr> </table> <br> Also, starting day for the week can be defined in overal language settings: