search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

End Date Incorrect - Too Long When Selecting, Too Short When Rendering

Asked by Pro User
7 years ago.

The end date is rendered incorrectly by one day.
This is also true when re-sizing, selecting etc.

User click and drags November 25 to November 30 in schedule.
Desired result:
Start Date: November 25
End Date: November 30

DayPilot Result:
Start Date: November 25
End Date: December 1

Please return and render the correct end date. You don't return November 26 when selecting November 25 as start date, why would you return December 1st when selecting November 30?

Adding and subtracting to the day returned or rendered by DayPilot is not a valid solution. A parameter needs to be made available to render and report whole days. I'm surprised that for such a mature library this common issue has not been resolved.

Answer posted by Dan Letecky [DayPilot]
7 years ago.

Since v7.9 (http://javascript.daypilot.org/daypilot-pro-for-javascript-7-9/) there is an option to treat the end date as date only:

http://api.daypilot.org/daypilot-scheduler-eventendspec/

At this moment it only affects loading events. Let me check the status for end date returned by drag and drop event handlers.

Comment posted by Dan Letecky [DayPilot]
7 years ago.

Build 7.9.1348 now applies the current eventEndSpec handling to the output values as well: onEventMove, onEventMoved, onEventMoving, onEventResize, onEventResized, onEventResizing, onTimeRangeSelect, onTimeRangeSelected, onTimeRangeSelecting, time range context menu.

You can download it in the sandbox:

http://javascript.daypilot.org/sandbox/

Let me know if there is any problem.

Comment posted by Pro User
7 years ago.

Using 7.9.1348
When I set dp.eventEndSpec = "Date"; it renders the event correctly but I cannot move or resize.

TypeError: $q.getDatePart is not a function
...ndSpec==="DateTime"){return $q;};return $q.getDatePart();};this.$8U=function(e,$...

dp.eventEndSpec = "DateTime"; works fine.

Comment posted by Dan Letecky [DayPilot]
7 years ago.

Version 7.9.1349 should fix that:

http://javascript.daypilot.org/sandbox/

Comment posted by Pro User
7 years ago.

7.9.1349 looks good.
Thank you very much :)
Saved me a lot of time by not having to add and subtract dates across the whole app.
I'm sure people will find this very useful.

Comment posted by Dan Letecky [DayPilot]
7 years ago.

No problem, thanks!

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.