NonWorkingTime
Feature that allows styling of weekends (and other non-working time) by adding timeRanges for those days.
//<code-header>
fiddle.title = 'Non-working time';
//</code-header>
const scheduler = new Scheduler({
appendTo : targetElement,
// makes scheduler as high as it needs to be to fit rows
autoHeight : true,
features : {
nonWorkingTime : true
},
startDate : new Date(2018, 4, 6),
endDate : new Date(2018, 4, 13),
columns : [
{ field : 'name', text : 'Name', width : 100 }
],
resources : [
{ id : 1, name : 'Bernard' },
{ id : 2, name : 'Bianca' }
],
events : [
{ id : 1, resourceId : 1, name : 'Sunday', startDate : '2018-05-07', endDate : '2018-05-08', iconCls : 'fa fa-arrow-left' },
{ id : 2, resourceId : 2, name : 'Saturday', startDate : '2018-05-11', endDate : '2018-05-12', iconCls : 'fa fa-arrow-right' }
]
});By default, the basic Scheduler's calendar is empty. When enabling this feature in the basic Scheduler, it injects Saturday and Sunday weekend intervals if no intervals are encountered. For Scheduler Pro, it visualizes the project calendar and does not automatically inject anything. You have to define a Calendar in the application and assign it to the project, for more information on how to do that, please see Scheduler Pro's Scheduling/Calendars guide.
Please note that to not clutter the view (and have a large negative effect on performance) the feature does not render ranges shorter than the base unit used by the time axis. The behavior can be disabled with hideRangesOnZooming config.
The feature also bails out of rendering ranges for very zoomed out views completely for the same reasons (see maxTimeAxisUnit for details).
Also note that the feature uses virtualized rendering, only the currently visible non-working-time ranges are available in the DOM.
This feature is disabled by default for Scheduler, but enabled by default for Scheduler Pro. For info on enabling it, see GridFeatures.
Configs
18
Configs
18Common
Other
The feature by default does not render ranges smaller than the base unit used by the time axis.
Set this config to false to disable this behavior.
The maximum time axis unit to display non-working ranges for ('hour' or 'day' etc). When zooming to a view with a larger unit, no non-working time elements will be rendered.
Note: Be careful with setting this config to big units like 'year'. When doing this, make sure the timeline start and end dates are set tightly. When using a long range (for example many years) with non-working time elements rendered per hour, you will end up with millions of elements, impacting performance. When zooming, use the zoomKeepsOriginalTimespan config.
Misc
Properties
21
Properties
21Class hierarchy
Functions
31
Functions
31Other
Based on this method result the feature decides whether the provided non-working period should
be rendered or not.
The method checks that the range has non-zero duration,
lays in the visible timespan and its duration is longer or equal the base timeaxis unit
(if hideRangesOnZooming is true).
Override the method to implement your custom range rendering vetoing logic.
| Parameter | Type | Description |
|---|---|---|
range | TimeSpan | Range to render. |
true if the range should be rendered and false otherwise.
Configuration
Events
Misc
Events
8
Events
8Event handlers
8
Event handlers
8Typedefs
2
Typedefs
2CSS variables
4
CSS variables
4| Name | Description |
|---|---|
--b-non-working-time-zindex | Non-working time z-index |
--b-non-working-time-opacity | Non-working time opacity |
--b-non-working-time-background | Non-working time background |
--b-non-working-time-header-background | Non-working time header background |