Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Month days show incorrect when firstDay is other than Sunday #14

Open
olegueret opened this issue Oct 22, 2015 · 4 comments
Open

Month days show incorrect when firstDay is other than Sunday #14

olegueret opened this issue Oct 22, 2015 · 4 comments

Comments

@olegueret
Copy link

In year view, the option firstDay when set to a value other than its default 0 (Sunday), makes the calendar's each day header title show the correct shifted day, but the actual days inside each month are not offset, so they show incorrect. In the other views (month, etc) the day offsets are correct.

When firstDay=0 it works fine: 2015-01-01 is a Thursday as expected:
first-day-sunday

When firstDay=1 (Monday), 2015-01-01 is transmuted to a Friday!
first-day-monday

@olegueret
Copy link
Author

I think I've found the problem:
Now I see there is a related bug #10 in which a comment was made indicating that it seemed to work fine in the frech demo at http://epsy.ldtp.net/fullcalendar/demos/year-french.html

The problem shows up when the lang-all.js is used (indicating the language with the lang parameter) instead of using a specific language with a script in the lang folder, like lang/fr.js

Please, see the attached this pastebin which shows the bug: 2015-01-01 should be a Thursday -jeu-.

@rori4
Copy link

rori4 commented Nov 5, 2017

Have you found a solution to this? It seems to work on the french demo but I still can't find where the issue is when I implement it in my project

@BlackRider666
Copy link

BlackRider666 commented Nov 5, 2017 via email

@rafwell
Copy link

rafwell commented Jan 14, 2022

Hi guys... Here I found the issue. Change the file https://github.com/tpruvot/fullcalendar/blob/yearview-v2.2.7/src/year/YearView.js#290

On line 290/291

Replace

dayGrid.start = range.start;
dayGrid.end = range.end;

By

dayGrid.start = range.start.add(view.firstDay, 'days');
dayGrid.end = range.end.add(view.firstDay, 'days');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants