jquery.schedule icon indicating copy to clipboard operation
jquery.schedule copied to clipboard

Problem with the time grid

Open olivierpetitjean opened this issue 5 years ago • 3 comments

First thank you for sharing this unique script.

I have some problems with the timetables:

  1. When I define the total range from 00:00 to 23:59 the last time slot (23:50 to 23:59) is not displayed in the grid. It stops at 23:50). I tried to set the range from 00:00 to 00:00 but the grid no longer appears.

  2. Then, when I try to move a schedule until 23:50 this not work, I cannot move to this last time slot. If I try to resize it works but the schedule displayed is not updated, it always stays at 23:40.

To reproduce this error, you just need to test the demo by changing the global time range from 00:00 to 23:59.

Another suggestion: it would be useful to be able to set a real time slot, for example from 08:00 to 04:00.

olivierpetitjean avatar Apr 05 '20 16:04 olivierpetitjean

As you can see in the screenshot below, if I try to expand scheduled to end of time grid then this causes a shift from the others. There is a problem with the end of the time grid and this unfortunately makes the plugin unusable.

Maybe you should make sure that the plugin can accept a full time slot, (from 00:00 to 23:59 or 00:00) and display the last 10-minute track?

Regards,

jqs

olivierpetitjean avatar Apr 05 '20 17:04 olivierpetitjean

I fixed the problem by replacing with:

line 467:

~~ui.position.left = Math.floor(ui.position.left / setting.widthTimeX) * setting.widthTimeX;~~

if (ui.position.left < setting.widthTimeX) {
     ui.position.left = 0;
} else {
     ui.position.left = Math.round(ui.position.left);
}  

Line 489 ~~var start = saveData.tableStartTime + Math.floor(x / setting.widthTimeX) * setting.widthTime;~~

var start = saveData.tableStartTime + Math.round(x / setting.widthTimeX) * setting.widthTime;

Line 725

~~var start = saveData.tableStartTime + Math.floor(x / setting.widthTimeX) * setting.widthTime;~~

var start = saveData.tableStartTime + Math.round(x / setting.widthTimeX) * setting.widthTime;

olivierpetitjean avatar Apr 11 '20 13:04 olivierpetitjean

This error occurred when I removed the container attribute from the draggable element and tried having elements go out of the page in conjunction with using datetimes. This worked but I used ui.position.left = Math.ceil(ui.position.left / setting.widthTimeX) * setting.widthTimeX; for line 467 and no errors.

thomasr96 avatar Oct 27 '20 20:10 thomasr96