StartDateField
Date field widget (text field + date picker) to be used together with Scheduling Engine. This field adjusts time to the earliest possible time of the day based on either:
- the event calendars (which is a combination of its own calendar and assigned resources ones) - if eventRecord is provided.
- the project calendar - if project is provided. The project start date is used as a default value for the min property. Also, the default value of the max property is set to be 200 years after the project's end date (or to the year 2300 if no project is provided).
Please note, that either eventRecord or project value must be provided.
This field can be used as an editor for the Column.
It is used as the default editor for the StartDateColumn.
//<code-header>
fiddle.title = 'Start date field';
//</code-header>
const project = new ProjectModel({
startDate : new Date(2020, 0, 1)
});
const startDateField = new StartDateField({
label : 'Choose start date',
appendTo : targetElement,
project
});Configs
127
Configs
127Other
Event model calendars of which should be used by the field.
A flag which indicates what time should be used for selected date.
sod by default which adjusts user provided value time to start of the working day.
Possible options are:
'sod'adjust user provided value time to start of the working dayfalseto reset time to midnighttrueto keep original time value'17:00'a string which is parsed automaticallynew Date(2020, 0, 1, 17)a date object to copy time from'entered'to keep time value entered by user (in case format includes time info)
Number of milliseconds to add to the project's start date. Then, during editing, the resulting date is assigned to the max property of the field, preventing the user from entering too high values.
This also prevents freezing, when user enters the date with five-digits year.
The value of this config will be passed to add, so in addition to number of milliseconds, strings like "1 year" are recognized.
Default value is '200 years'
Number of milliseconds to add to the project's start date (should be negative). Then, during editing, the resulting date is assigned to the min property of the field, preventing the user from entering too low values.
This also prevents freezing, when user enters the incomplete date with one-digit year.
The value of this config will be passed to add, so in addition to number of milliseconds, strings like "-1 year" are recognized.
Default value is '-10 years'
Project model calendar of which should be used by the field.