bootstrap_calendar
bootstrap_calendar copied to clipboard
Starting day of the week
There isn't an option for changing starting day of weeks. In some countries Monday is the first day of the week. So It must be iterate the day according to that.
have a look at the project the boostrap calendar is forked from https://github.com/bichotll/bic_calendar - it's starting day is monday, not sunday. that was one of the reasons i created this fork, as an english translation. but you're probably correct, that is an option i should look into adding as a configuration option.
Solved!
// Modify the related function
function calculateWeekday(day,month,year){
var dateObj = new Date(year, month, day);
var numDay = dateObj.getDay();
/* EMR */
numDay -= startWeekDay;
if(numDay == -1)
numDay = 6;
/* END EMR */
return numDay;
}
// Initialize the param
/* EMR */
var startWeekDay = 0; // Default: sunday
if (typeof args.startWeekDay != 'undefined')
startWeekDay = args.startWeekDay;
/* END EMR */
// Use it in your main
startWeekDay: 1,
:+1: