So I installed the calendar with the dnd add-on on my local dev environment. I noticed that the returned start and end values from onEventDrop callback do not work as expected if the event is dropped in a "Day" cell in the week view. I was expecting that both of start and end (or at least start) to have time stripped off. However, it looks like they always have the same time values as the original event does. I looked into the source code and I believe it's the function getEventTimes inside backgroundWrapper.js that is causing the issue. I wonder if this behavior is a bug or it's intentional. Many thanks.
P.S: On the demo, it looks like the returned start value works correctly.
Same problem and end date is invalid obj
why would the times be stripped off in the week view? you are actively positioning the event in a time right?
events={this.state.events}
startAccessor={(event) => {return moment(event.start).toDate()}}
endAccessor={(event) => {return moment(event.end).toDate()}}
my start dates and end dates look like this from graphql and moment is able to conver it to a date object:
END: 2017-01-17T10:30:00.000Z
MOMENT: Tue Jan 17 2017 05:30:00 GMT-0500 (EST)
when it actually does the move event the end date becomes invalid and i cannot console log the end date.
start date appears to be fine in the week view but if it's the month view the date gets chopped off.
it was working last week and i don't recall changing anything
my data is stored as an ISODate. and it appears to work if i force graphql to pass back the date as a serialized number and not a string 2017-01-17T10:30:00.000Z does this make sense?
ah I think it was working by accident for you, and now that a bug was fixed (https://github.com/intljusticemission/react-big-calendar/pull/311) its breaking because we don't use the start/end accessors b/c I haven't released https://github.com/intljusticemission/react-big-calendar/pull/337 yet
@jquense Hello, are you gonna release it anytime soon? Thank you
Has this been fixed? I am having an issue with the onEventDrop not firing on days (month view), but it does work when using the week view. Not sure if I should create a new issue or not?
I had a similar issue to @kedmenec and found that import "react-big-calendar/lib/addons/dragAndDrop/styles.less"; was not correctly importing as I did not have a less hotloader/transpiler running. The solution for me was to manually compile the less code to css and inject that alongside the regular BigCalendar files, as the pointer-events were not correctly working.
I had the same issue as @kedmenec and @singular1ty94, and was able to fix it by just changing the style import to import "react-big-calendar/lib/addons/dragAndDrop/styles.css" (.css instead of .less - both files are available in that folder - I'm using version 0.17.0).
It sounds like this is fixed, so I'll go ahead and close it. But feel free to re-open if this is not the case!
Most helpful comment
I had the same issue as @kedmenec and @singular1ty94, and was able to fix it by just changing the style import to
import "react-big-calendar/lib/addons/dragAndDrop/styles.css"(.cssinstead of.less- both files are available in that folder - I'm using version 0.17.0).