new DatePicker(id, properties) → {Object}
Parameters:
| Name |
Type |
Description |
id |
String
|
The id of the component. |
properties |
Object
|
HTMLElement
|
The properties used to initialize the component or the container element. |
- Mixes In:
Returns:
An instance of the component.
-
Type
-
Object
Extends
Classes
- DatePickerEvents
Members
allowedDates :Array.<String>|Array.<Date>
Gets or sets a list of allowed calendar dates. Separate two date strings with a space to specify allowed range. When allowed dates are set, date input fields are rendered in readonly mode.
Type:
-
Array.<String>
|
Array.<Date>
autoFocus :Boolean
Gets or sets a value indicating whether focus on an input field is automatically moved to the next field while typing.
Type:
calendarDayLeadingZero :Boolean
Gets or sets a value indicating whether a calendar day has a leading zero.
Type:
calendarMonthNumericBoxId :String|null
Gets or sets the id of the month numeric box in the calendar from which the settings are cloned.
Type:
calendarYearNumericBoxId :String|null
Gets or sets the id of the year numeric box in the calendar from which the settings are cloned.
Type:
cssClassCalendar :String
Gets or sets the css class of the calendar dialog.
Type:
cssClassCurrentWeek :String
Gets or sets the css class of the current week row in the calendar.
Type:
cssClassDay :String
Gets or sets the css class of the day input.
Type:
Gets or sets the css class of the calendar header label.
Type:
cssClassInactive :String
Gets or sets the css class of an inactive day cell in the calendar.
Type:
cssClassMonth :String
Gets or sets the css class of the month input.
Type:
cssClassNextMonth :String
Gets or sets the css class of the next month button.
Type:
cssClassNumericBox :String
Gets or sets the css class of the numericbox.
Type:
cssClassPicker :String
Gets or sets the css class of the picker button.
Type:
cssClassPrevMonth :String
Gets or sets the css class of the prev month button.
Type:
cssClassToday :String
Gets or sets the css class of the current day cell in the calendar.
Type:
cssClassWeekNumber :String
Gets or sets the css class of the week number cell in the calendar.
Type:
cssClassYear :String
Gets or sets the css class of the year input.
Type:
Gets or sets the input format for dates. Default: MM/dd/yyyy.
Type:
dayNumericBoxId :String|null
Gets or sets the id of the day numeric box from which the settings are cloned.
Type:
dayPlaceholder :String
Gets or sets the placeholder which is visible when the day input box has no value. Default: DD.
Type:
days :Array.<String>
Gets or sets the day names.
Type:
dialogId :String|null
Gets or sets the id of the dialog from which the settings are cloned.
Type:
disabled :Boolean
Gets or sets a value indicating whether the date picker is disabled.
Type:
disallowDates :Boolean
Gets or sets a value indicating if the dates specified in the dates property are disallowed instead of the default allowed.
Type:
Type:
Gets or sets the first day of the week.
Type:
Gets or sets the id of the hidden input from which the settings are cloned. The hidden input contains the date in the configured date-format when a valid date is given.
Type:
maxValue :String|Date|null
Gets or sets the maximum allowed date value.
Type:
minValue :String|Date|null
Gets or sets the minimum allowed date value.
Type:
monthNumericBoxId :String|null
Gets or sets the id of the month numeric box from which the settings are cloned.
Type:
monthPlaceholder :String
Gets or sets the placeholder which is visible when the month input box has no value. Default: MM.
Type:
months :Array.<String>
Gets or sets the month names.
Type:
name :String
Gets or sets the hidden input field name which contains the selected date in the specified date format.
Type:
Gets or sets the id of the picker button from which the settings are cloned.
Type:
readOnly :Boolean
Gets or sets a value indicating whether the date picker is readonly.
Type:
Gets or sets the size option.
Type:
today :Boolean
Gets or sets a value indicating whether today should be used as initial selected date.
Type:
value :String|Date|null
Gets or sets the initial date value.
Type:
Gets or sets the view mode in which the date picker is rendered.
Type:
weekNumbers :Boolean
Gets or sets a value indicating if week numbers are displayed in the calendar.
Type:
yearNumericBoxId :String|null
Gets or sets the id of the year numeric box from which the settings are cloned.
Type:
yearPlaceholder :String
Gets or sets the placeholder which is visible when the year input box has no value. Default: YYYY.
Type:
(static, readonly) FirstDayOfWeekOption :number
Type:
Properties:
| Name |
Type |
Description |
SUNDAY |
number
|
|
MONDAY |
number
|
|
SATURDAY |
number
|
|
(static, readonly) ViewModeOption :number
Type:
Properties:
| Name |
Type |
Description |
INPUT_CALENDAR_POPUP |
number
|
|
INPUT_CALENDAR_STATIC |
number
|
|
INPUT |
number
|
|
CALENDAR |
number
|
|
CALENDAR_POPUP |
number
|
|
Methods
clear(fireEventopt)
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
fireEvent |
Boolean
|
<optional>
|
false
|
A value indicating if the onChanged event is fired. |
destroy()
- See:
-
Gets the calendar month numeric box.
Returns:
The numeric box instance.
-
Type
-
componyx.UI.NumericBox
Gets the calendar year numeric box.
Returns:
The numeric box instance.
-
Type
-
componyx.UI.NumericBox
getDate() → {Date}
Returns:
-
Type
-
Date
Gets the day numeric box.
Returns:
The numeric box instance.
-
Type
-
componyx.UI.NumericBox
getISOValue() → {String}
Gets the input field value as ISO8601 string.
Returns:
The selected date value as ISO8601 string.
-
Type
-
String
Gets the month numeric box.
Returns:
The numeric box instance.
-
Type
-
componyx.UI.NumericBox
getValue() → {String}
Gets the input field value which holds the date in the specified date format.
Returns:
The selected date value in the specified date format.
-
Type
-
String
Gets the year numeric box.
Returns:
The numeric box instance.
-
Type
-
componyx.UI.NumericBox
hideCalendar()
isAllowedDate(date) → {Boolean}
Gets a value indicating if the specified date is allowed.
Parameters:
| Name |
Type |
Description |
date |
Date
|
String
|
The date to check. |
Returns:
A value indicating if the date is allowed.
-
Type
-
Boolean
postRender()
Executes the post render procedure.
render()
reset(fireEventopt)
Resets all inputs to the initial value.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
fireEvent |
Boolean
|
<optional>
|
false
|
A value indicating if the onChanged event is fired. |
select()
Selects the text of the first input field of the datepicker.
setDate(date, fireEventopt)
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
date |
Date
|
|
|
The date object. |
fireEvent |
Boolean
|
<optional>
|
false
|
A value indicating if the onChanged event is fired. |
setSeparatorTemplate(content)
Defines the template for the input separator.
Parameters:
| Name |
Type |
Description |
content |
HTMLElement
|
Array.<HTMLElement>
|
DocumentFragment
|
String
|
The content of the template. |
setValue(value, fireEventopt)
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
value |
String
|
|
|
The date value in the specified date format. |
fireEvent |
Boolean
|
<optional>
|
false
|
A value indicating if the onChanged event is fired. |
showCalendar()
suppressNextChangeEvent(action)
Suppresses any change events fired by the underlying input element during the execution of the provided action. Use this when programmatically setting a component value to prevent the change event from propagating as a user interaction.
The suppression is automatically lifted after the action completes, even if it throws.
Parameters:
| Name |
Type |
Description |
action |
function
|
The action to execute with change events suppressed. |
- Mixes In:
Type Definitions
CalendarRenderEventArgs
DatePicker calendar render event arguments (week and day).
Type:
Properties:
| Name |
Type |
Attributes |
Description |
row |
HTMLTableRowElement
|
|
The table row of the calendar week. |
cell |
HTMLTableCellElement
|
<optional>
|
The table cell of the calendar day (onCalendarDayRender only). |
button |
componyx.UI.Button
|
<optional>
|
The button of the calendar day (onCalendarDayRender only). |
date |
Date
|
|
The date of the first day shown in the week row (week render) or the date of the day (day render). |
ChangedEventArgs
DatePicker changed event arguments.
Type:
Properties:
| Name |
Type |
Description |
date |
Date
|
null
|
The selected date, or null when the date was cleared. |