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

Strange error on TimeRangeSelected, happening just in the new version.

Asked by Anonymous
2 months ago.

Everything is wrong on the onTimeRangePicked datas…. the resource id, the hour picked (i should be picking only 00.15/00.30/00.45/0.00 and instead it seesm to be giing me some random nums.
In the screen you can see the same cell picked in the oldest version of the library.
In the video you see what happens with the new version.
All the data wew good, the only thing changed is the verison of daypilo. Please help c:

Answer posted by Dan Letecky [DayPilot]
2 months ago.

This is a regression. It looks like in the Resources view, the latest version returns the column index instead of the resource id. It will be fixed shortly.

Comment posted by Anonymous
2 months ago.

Please, look also at the hours that i get. It returns like 3.16 and stuff like that. And it changes on which point of the cell i press.

Comment posted by Anonymous
2 months ago.

Will the fix be available also for pro verison? this is a breaking point

Comment posted by Dan Letecky [DayPilot]
2 months ago.

The 2023.4.5838 release, which contained the bug, has been recalled and replaced by version 2023.4.5839 that resolves the issue.

Now it correctly returns the the column id.

> Please, look also at the hours that i get. It returns like 3.16 and stuff like that. And it changes on which point of the cell i press.

This happens when you disable snap-to-grid in the Calendar. In addition to event moving and resizing, it also affects time range selection/click.

In the next release, it will be possible to turn off snap-to-grid for selected drag-and-drop operations only. This is already implemented in the Scheduler (e.g., snapToGridTimeRangeSelecting).

Another option is to adjust the date manually to match the cell start.

Comment posted by Anonymous
2 months ago.

Yes, but it shows random numbers like 6:7

Comment posted by Anonymous
2 months ago.

How can i access the cell start date?

Comment posted by Anonymous
2 months ago.

?

Comment posted by Dan Letecky [DayPilot]
2 months ago.

You can calculate the cell start from the exact time like this:

const time = args.start;
const startOffset = time.getTime() % (calendar.cellDuration * 60 * 1000);
const cellStart = time.addTime(-startOffset);
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.