Our pure JavaScript Scheduler component


Post by albert.piacka »

Hi!

I would like to ask for help with a certain functionality in the scheduler. When I drag an event, it "snaps" to 00:00:00 time, but when I drop it, it snaps to the correct value it already had defined (e.g., 12 AM).

I am not sure if this is a bug or if my configuration is missing something. I think the snapRelativeToEventStartDate property might not be working as intended.

Here's my current config:

      infiniteScroll: true,
      rowHeight: 50,
      hideHorizontalScrollbar: true,
      zoomOnTimeAxisDoubleClick: false,
      zoomOnMouseWheel: false,
      allowOverlap: false,
      snap: true,
      snapRelativeToEventStartDate: true,
      useInitialAnimation: false,
      viewPreset: 'monthAndDay',
      
visibleDate: { date: dayjs().startOf('day').toDate(), edgeOffset: 100 },

using this view preset config:

    id: 'monthAndDay',
    timeResolution: {
      unit: 'day',
      increment: 1
    },

Here's the video to demonstrate my issue:
https://www.awesomescreenshot.com/video/28563940?key=ed1be5896c3add855b4ecb6e9f805bbb

I'd be grateful for any help.


Post by mats »

What version are you using?


Post by albert.piacka »

Bryntum Scheduler 5.6.9

// edit


Post by mats »

Does it work if you upgrade to 5.6.12?


Post by albert.piacka »

The drag operation works, but resizing does not (it snaps to 00:00:00).
Also, is there a way to snap a new event to a pre-defined time when creating it by dragging? I use 'onBeforeEventEdit' to adjust the time after the event has been created:

      onBeforeEventEdit({ eventRecord }: { eventRecord: ReservationModel }) {
            eventRecord.setStartDate(
                dayjs(eventRecord.startDate).clone().hour(14).minute(0).second(0).millisecond(0).toDate(),
            )
            eventRecord.setEndDate(
                dayjs(eventRecord.endDate).clone().hour(10).minute(0).second(0).millisecond(0).toDate(),
            )
      },

Here's the video:

https://www.awesomescreenshot.com/video/28637821?key=72ddd3a775b4fadc87d79b3759fb2322

Thanks!


Post by alex.l »

Hi,

Thanks for the info, I've reproduced the problem in our environment. Here is the ticket https://github.com/bryntum/support/issues/9394
You can subscribe on ticket updates to be notified when it's done.

Also, is there a way to snap a new event to a pre-defined time when creating it by dragging?

Only with custom code. Your solution looks reasonable to me. The only thing, use this method, it will handle operation faster https://bryntum.com/products/scheduler/docs/api/Scheduler/model/TimeSpan#function-setStartEndDate

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy

We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services


Post Reply