jackducasse / caleandar

A lightweight, library independent JavaScript calendar
MIT License
80 stars 41 forks source link

Start Day in Germany is Monday #6

Open solitaer opened 6 years ago

solitaer commented 6 years ago

Hi, can i start the Calendar with firstday = Monday?

ZsulaR commented 6 years ago

Hi, i found the solution. :) Change this this.Selected.FirstDay = new Date(this.Selected.Year, (this.Selected.Month),1).getDay(); to this.Selected.FirstDay = new Date(this.Selected.Year, (this.Selected.Month), 0).getDay(); and this var labelsList = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]; to var labelsList = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat","Sun"];

I hope it helps. :)

n3rvio commented 6 years ago

If you only change those lines, the extra days of each month will appear off-site.

Also change these lines in calendar.js :

    // Next Month's Days
    // Always same amount of days in calander
    var extraDays = 13;
    if(days.children.length>35){extraDays = 6;}

For these

    // Next Month's Days
    // Always same amount of days in calander
    var extraDays = 14;
    if(days.children.length>35){extraDays = 7;}