Apeend the event on Top on the day


#1

Hello, i am trying to make a event of one day (startdate=15-06-2022 enddate=15-06-2022), but i want that event to be presented like this:

Is that possible? If not i need to find onther solution.

Ty for your help!


#2

Hello,
If you want to display one-day events like multiday events on the top of the scale, you can use scheduler.config.full_day config, which enables to set the duration of the events to the full day and shows them as multiday events:
https://docs.dhtmlx.com/scheduler/api__scheduler_full_day_config.html ;
To create a full day event, you can use the onBeforeLightbox event with already start and end dates between midnight and midnight:

scheduler.attachEvent("onBeforeLightbox", function (id) {
    if (scheduler.getState().new_event) {
        let ev = scheduler.getEvent(id);
        ev.start_date = scheduler.date.day_start(ev.start_date);
        ev.end_date = scheduler.date.add(ev.start_date, 1, "day");
    }
    return true;
});

or just to press full day checkbox.
Here related articles:
https://docs.dhtmlx.com/scheduler/api__scheduler_onbeforelightbox_event.html ;
https://docs.dhtmlx.com/scheduler/api__scheduler_date_other.html ;
Please check the example of how it might be implemented:
https://snippet.dhtmlx.com/z8tda4gi