addMarkedTimespan
Description
Markiert Datumsangaben, aber bei bestimmten Einstellungen führt dies zu einer Blockierung (das Festlegen eines benutzerdefinierten Stils für das Limit ist möglich)
addMarkedTimespan: (config: any) => number
Parameters
config- (erforderlich) Objekt - das Konfigurationsobjekt des zu markierenden bzw. blockierenden Zeitraums
Returns
id- (number) - die ID des hinzugefügten Zeitraums
Example
// marks dates
scheduler.addMarkedTimespan({
days: 5, // marks each Friday
zones: "fullday", // marks the entire day
css: "gray_section" // the name of applied CSS class
});
scheduler.updateView();
// marks and blocks dates
scheduler.addMarkedTimespan({
days: 5,
zones: "fullday",
css: "gray_section",
type: "dhx_time_block" // the hardcoded value
});
scheduler.updateView();
Related samples
Details
The method is available from version 3.5.
Die Methode erfordert das aktivierte [limit]-Plugin.
Hinweis: Das Markieren (Blocking) wird nicht direkt nach dem Aufruf der Methode angewendet. Sie sollten updateView() aufrufen, um die Markierung anzuwenden.
Configuration object properties
The configuration object can contain the following properties:
Property | Description |
|---|---|
| start_date | a Date object that sets the limitation start date |
| |
| end_date | a Date object that sets the limitation end date |
| |
| days | days that should be limited |
| |
| zones | the period in minutes that should be limited |
| |
| css | the name of a css class |
| |
| html | an HTML content that will be added to the marked range |
| |
| type | defines the time span's type. The 'dhx_time_block' type 'says' to apply blocking to the timespan. With any other type (you can specify any value) set, events will be just marked |
| |
| invert_zones | specifies, whether time zones (set by the 'zones' property) must be inverted (default - false) |
| |
| sections | allows blocking date(s) just for specific items of specific views. The specified date(s) will be blocked only in the related view(s) |
| |
Acceptable combinations of config properties
Note, days, zones and start_date, end_date properties are used in pairs to set the blocking interval and can't be mixed and used in some other variation. For example, you can't specify zones, start_date or days, start_date, end_date at the same time.
Therefore, there are 2 acceptable combinations with specific set of properties:
Set of properties | Example |
|---|---|
| |
| |
markTimespan() and addMarkedTimespan() comparison
addMarkedTimespan | markTimespan |
requires calling the | draws a DIV for the time span automatically |
the time span(s) exists all time along | der Zeitraum existiert dauerhaft |
returns the ID of the configured time span(s) | returns a DIV or an array of DIVs |