themouette/jquery-week-calendar

Broken on month Change Events

Opened this issue · 1 comments

Hi Team,

There is an issue in JSON Calendar , If last day of month is Sunday and a user creates a record for 11:00 PM to 12:00 AM , the record dose not shows up.

Steps to reproduce :

Change Dates in HTML FIle - weekcalendar_json.html - Line 53 to 55.

date: new Date('2016-01-31T13:15:00.000+10:00'),
minDate: new Date('2016-01-31T13:15:00.000+10:00'),
maxDate: new Date('2016-02-06T13:15:00.000+10:00'),
Now in file : events.json - Place the JSON as

[
{"id":1, "start":"2016-01-31T23:00:00.000+05:30", "end":"2016-01-31T24:00:00.000+05:30", "title":"Lunch with TEst1"},
{"id":2, "start":"2016-02-03T23:00:00.000+05:30", "end":"2016-02-03T24:00:00.000+05:30", "title":"Lunch with Test2"}
]

You cannot see the Event on Sunday 31 JAn.

Now change JSON to 👍

[
{"id":1, "start":"2016-01-31T23:00:00.000+05:30", "end":"2016-01-31T23:59:00.000+05:30", "title":"Lunch with TEst1"},
{"id":2, "start":"2016-02-03T23:00:00.000+05:30", "end":"2016-02-03T24:00:00.000+05:30", "title":"Lunch with Test2"}
]

You will be able to see Calendar Event.

Can someone help me to fix this ?

I had this issue as well I found it to be an issue with line 1528 in the _renderEvents function in the main javascript file. Its setting the Date before setting the month if you switch the lines to have the month set then the date it doesnt have this issue.