Our pure JavaScript Scheduler component


Post by bernhard »

I am trying to get the nonWorkingTime feature to work in React. I succeeded when using the example below in a plain JS-component.
I used <BryntumSchedulerPro nonWorkingTimeFeature /> as suggested by the console output. I expected a grey shade for Saturdays and Sundays but unfortunately they are as white as the rest of the week days.

Link to Github.


Post by saki »

nonWorkingTime is intended to be used with non-Pro scheduler. Scheduler Pro has support for calendars that should be used.

Here is the App.Config that works:

/**
 * Application configuration
 */

const schedulerConfig = {
    startDate: new Date(2021, 10, 1),
    endDate: new Date(2021, 10, 20),
    barMargin: 10,
    rowHeight: 60,

    viewPreset: 'weekAndDay',

    columns: [{ type: 'resourceInfo', width: 200 }],
    project: {
        calendar: 'weekends',
        calendarsData: [
            {
                id: 'weekends',
                name: 'Weekends',
                intervals: [
                    {
                        recurrentStartDate: 'on Sat at 0:00',
                        recurrentEndDate: 'on Mon at 0:00',
                        isWorking: false
                    }
                ]
            }
        ],

        resourcesData: [
            {
                id: 1,
                name: 'John'
            }
        ],

        eventsData: [
            {
                id: 1,
                name: 'Event',
                startDate: '2021-11-02',
                endDate: '2021-11-04',
                calendar: 'workdays'
            }
        ],

        assignmentsData: [
            {
                id: 1,
                eventId: 1,
                resourceId: 1
            }
        ]
    }
};

export { schedulerConfig };

and App.js

/**
 * The React App file
 */

// React libraries
import React from 'react';

// Stylings
import './App.scss';

// Application components
import { BryntumSchedulerPro } from '@bryntum/schedulerpro-react';
import { schedulerConfig } from './AppConfig';

const App = () => {
    return <BryntumSchedulerPro {...schedulerConfig} />;
};

export default App;

Post by bernhard »

The documentation of NonWorkingTime of the SchedulerPro led me to believe that this was in fact correct:

This feature is off by default for Scheduler, but enabled by default for Scheduler Pro. For info on enabling it, see GridFeatures.

According to the documentation I didn't even have to enable it in my example.
This and the fact that the SchedulerPro documentation actually has the feature in its list of features.

That leads me to the question: Is the documentation outdated?


Post by saki »

Actually, NonWorkingTime feature is used internally by Scheduler Pro. The difference is that for Pro it takes data from calendars, not from auto-generated weekends as for non-Pro scheduler.


Post by bernhard »

Which part of the documentation mentions that one should not consider NonWorkingTime to work with SchedulerPro but instead head over to the calendars as you suggested? It takes a lot of time to try out a solution that does not seem to work that was due to misleading information in the documentation.


Post by saki »

The documentation does not mention it but I have updated it right now so it will be clear that the feature is attached to calendars.

Note: The updated docs will appear online on the next patch release.


Post by bernhard »

Thank you! You can close this thread.


Post Reply