tpruvot / fullcalendar

Year view implementation
http://epsy.ldtp.net/fullcalendar/demos/
MIT License
83 stars 26 forks source link

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

Open olegueret opened 8 years ago

olegueret commented 8 years ago

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 commented 8 years ago

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 commented 6 years ago

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 commented 6 years ago

Thanks, I found.

5 нояб. 2017 г. 3:55 PM пользователь "rori4" notifications@github.com написал:

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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tpruvot/fullcalendar/issues/14#issuecomment-341974925, or mute the thread https://github.com/notifications/unsubscribe-auth/ALCpstO4BuPU70i8Xj_sr-dk7jbDK-yeks5szb5pgaJpZM4GT7UO .

rafwell commented 2 years ago

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');