williamtroup/Calendar.js

New Event not setting date correctly.

Gfellha opened this issue · 5 comments

So while playing around with the program, I noticed that when using the add events (the one right in the thing, where you can right-click a cell, and click the add new events and the model pops up) I discovered is that whatever I date I inserted into the dialog, the event would always appear on the day before the day I selected. I have a set of images I'm attaching showing what I did and the outcome that comes up.

exmaple one
example two
example 3

As you can see, despite selected the sixteenth as the date, it appears on the fifteenth.

I found out what the issue was. In the getSelectedDate function, you have result = new Date( input.value); where input.value is just the date (without the time). I just changed it to:
result = new Date( input.value + ' 00:00'); and now it appears on the date that is specified in the model.

Also, if you want, I can 'commit' the edits I made to correct this bug. (Atleast, I presume it's a bug). However, I feel there is a more elegant solution to the issue, that eludes me.

Hi there, I'm aware of this bug and it will be fixed in the next version.

Can you tell me what Locale your in and what browser you are using?

Thanks

I'm using google Chrome for my browser, and what exactly do you mean by locale exactly?

Ah sorry, tired and mis-read your comment. Thanks again for reporting this bug. Your fix is very similar to the one I have put in place, so you can use that fix until the next release.

Thanks again.

Should be fixed in v0.9.4.