Hide non-working hours

Is it possible to not render non-working times?  


Screenshot 2024-12-29 155933.png


3 Replies 1 reply marked as answer

AK Ashokkumar Karuppasamy Syncfusion Team December 30, 2024 12:28 PM UTC

Hi Terry Lease,

To achieve your requirement, use the
startHour and endHour properties in the schedule to render only the work hours in the cells. The attached code snippet, sample, and demonstration are provided below. Additionally, the UG is attached below for your reference. Please try the solution and let us know if you need any further assistance.

UG: https://ej2.syncfusion.com/documentation/schedule/working-days#scheduler-displaying-custom-hours

Sample: https://stackblitz.com/edit/3iqzj7yy-soabb4qx?file=index.ts

    let scheduleObjSchedule = new Schedule({

        height: '650px',

        selectedDate: new Date(2021010),

        currentView: 'TimelineWeek',

        startHour: '08:00',

        endHour:'15:00',

        workDays: [012345],

        views: [

            { option: 'TimelineDay' },

            { option: 'TimelineWeek' },

            { option: 'TimelineWorkWeek' },

            { option: 'TimelineMonth' },

            { option: 'Agenda' }

        ],

        eventSettings: {

            dataSource: <Object[]>extend([], (dataSource as any).scheduleData.concat((dataSource as any).timelineData), nulltrue)

        }

    });

    scheduleObj.appendTo('#Schedule');

 



Regards,
Ashok


Marked as answer

TL Terry Lease December 30, 2024 06:41 PM UTC

Thank you!  I had the work hours defined but not start and end hours.  That worked great!




AK Ashokkumar Karuppasamy Syncfusion Team December 31, 2024 01:06 PM UTC

Hi Terry Lease,

We are glad to know that your issues have been resolved. Please get back to us if you need any further assistance.

Regards,
Ashok


Loader.
Up arrow icon