calendariofx / calendario

A small calendar library for creating flexible calendars.
http://calendariofx.github.io/Calendario/docs/
MIT License
57 stars 14 forks source link

Events on the same date of the previous and current month are rendered in the same day #20

Closed mityakoval closed 7 years ago

mityakoval commented 7 years ago

I will just post some screenshots because this issue is quite hard to explain.

screen shot 2016-12-13 at 12 36 02 screen shot 2016-12-13 at 12 36 12

And this is the output from the console at the time of rendering: This is December. As you can see it has 8 events in total for the first day of the month - 4 events for Dec 1 and another 4 for Jan 1. However, all 8 are placed on Jan 1.

screen shot 2016-12-13 at 12 39 37

I double checked my backend to return correct data.

deviprsd commented 7 years ago

I will need more data to understand what is happening, can you provide me with a link to this project of yours or something?

mityakoval commented 7 years ago

@deviprsd21 I have sent you the link and credentials to deviprsd21@gmail.com

mityakoval commented 7 years ago

@deviprsd21 You can see actual events on a certain day by clicking on it.

deviprsd commented 7 years ago

2016-12-13 3 I'm testing your backend data with Calendario v5.0.1 (Released a long time ago) and this is the result. And that is the month of December with Jan 1st as it's last date.

mityakoval commented 7 years ago

OK. So it's probably my code. Any ideas what might be causing such behaviour? Because I have changed the implementation a little bit. But I've compared Calendario.prototype.parseDay and Calendario.prototype.parseDataToDay functions to my code and they are the same.

deviprsd commented 7 years ago

It seems you have made some changes with original js file, do look into it. And I can't seem to think why it is happening with you without knowing what changes you have made so far. Also this looks similar to #13, Look into that too

mityakoval commented 7 years ago

@deviprsd21 Replaced my code with the original and still the same problem. Just to be sure that the server sends correct data:

screen shot 2016-12-13 at 14 15 20

deviprsd commented 7 years ago

Looks like I'm able to reproduce it. I will look into it.

mityakoval commented 7 years ago

Thanks for your time :)

deviprsd commented 7 years ago

Let me know if this worked and give some suggestions for v6 in which way I can make Calendario life more rich and easier

mityakoval commented 7 years ago

Updated my code with your commit. The issue is fixed for the next month but it is still there for the current month.

screen shot 2016-12-13 at 15 37 39

It still displays events from Nov 30 on Dec 30

deviprsd commented 7 years ago

This should completely fix everything.

mityakoval commented 7 years ago

Awesome! Works for me. Thank you! :)