Skip to content

Bug: Resizing 0h event with same start and end time #2011

@BlackRockSoul

Description

@BlackRockSoul

Resizing an event that has the same start and end dates cause the start date to become 'Invalid date'.

image

This happens because this line of code adds 1 day to 0h events for some reason.

// make zero duration midnight events at least one day long
if (isZeroDuration) end = dates.add(end, 1, 'day')

And after that, the closestSlotFromDate function is not able to find the closest slot because the closest to the end is already the next day.

const diffMins = dates.diff(start, date, 'minutes')
return slots[(diffMins - (diffMins % step)) / step + offset]

It just returns undefined instead of a correct slot - offset -1 doesn't help at all.

image

In this case offset should be at least -49
I'm not sure if adding 1 day to an event is necessary in some particular cases, but I'd remove this - without this line, I'm not getting any errors in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions