Possibility to choose the time every half hour (timescale interval-1440, slotCount-1)

Hi,

We are using the following config on scheduler:

<e-schedule-timescale interval="1440" slotCount="1" enable="true"></e-schedule-timescale>

With this setting, only one hour can be selected:

Image_1081_1703068164179

Is it possible, with such timescale settings, to be able to select the time from the selection list with the accuracy of half an hour?


1 Reply

SK Satheesh Kumar Balasubramanian Syncfusion Team December 22, 2023 03:08 AM UTC

Hi Lukasz,

You can choose the time every half hour using popupOpen event as shown in the code snippets.

Index.cshtml:

<div class="col-lg-9 control-section">

    <div class="content-wrapper">
        <ejs-schedule id="schedule" popupOpen="OnPopupOpen" width="100%" height="650px" cssClass="time-scale" selectedDate="new DateTime(DateTime.Today.Year, 1, 10)" currentView="TimelineWeek" workDays="@ViewBag.workDays">
            <e-schedule-timescale interval="1440" slotCount="1" enable="true"></e-schedule-timescale>
            <e-schedule-views>
                <e-schedule-view option="Day"></e-schedule-view>
                <e-schedule-view option="Week"></e-schedule-view>
                <e-schedule-view option="TimelineDay"></e-schedule-view>
                <e-schedule-view option="TimelineWeek"></e-schedule-view>
            </e-schedule-views>
            <e-schedule-eventsettings dataSource="@ViewBag.datasource"></e-schedule-eventsettings>
        </ejs-schedule>
    </div>
</div>

<script type="text/javascript">
    function OnPopupOpen(args) {
        if (args.type === 'Editor') {
            var dialogObj = args.element.ej2_instances[0];
            dialogObj.open = (e) => {
                var startElementObj = args.element.querySelector('#StartTime').ej2_instances[0];
                startElementObj.step = 30;
                var endElementObj = args.element.querySelector('#EndTime').ej2_instances[0];
                endElementObj.step = 30;
            };
        }
    }
</script>

Regards,
Satheesh

Attachment: CoreSchedule_46a3d67d.zip

Loader.
Up arrow icon