CalendarJS
CalendarJS copied to clipboard
Week days starting on Monday
I came accross your calendar and it is exactly what ive been looking for, but is there a way the calendar can start on a Monday rather than Sunday?
not currently, but i've been meaning to re-write this and when i do i'll be sure to add that.
it is possible with only few code changes in calendar.js
change the lines (62, 63):
...
this.daysOfWeekFull = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
this.daysOfWeekAbbr = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
...
to
...
this.daysOfWeekFull = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"];
this.daysOfWeekAbbr = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
...
and insert firstDayofWeek = (firstDayofWeek + 6) % 7; after line 280
...
var firstDayofWeek = new Date(this.year, this.month, 1).getDay(),
lastDate = new Date(this.year, this.month + 1, 0).getDate(),
currentDate = 1,
currentDay = 0,
currentWeek = 0;
firstDayofWeek = (firstDayofWeek + 6) % 7; // this is the line to insert
// draw title bar
...