Skip to main content
Skip table of contents

datePicker

An HTML content command that, when evaluated, becomes a component allowing the user to select a date. When the Form is submitted, the selection will appear in the variable context as a Date value.  

Attributes

name

Required

Value type

EL-evaluated

No

String

Yes

Defines the name of the variable that will hold the Date value representing the selected date.

value

Required

Value type

EL-evaluated

No

Date, DateTime

Yes

Defines the initial value of the datepicker.

If not defined, the datepicker starts out by showing the current day.

popup

Required

Value type

EL-evaluated

No

Boolean

Yes

If the resolved value of this attribute is true, the produced datepicker is an input element, which, when clicked, opens up the otherwise-hidden datepicker. Otherwise the datepicker appears as a block-level element.

dateformat

Required

Value type

EL-evaluated

No

String

Yes

If the datepicker appears as a popup (the popup attribute resolves into true), its input element displays the selected date and this attribute can define the format in which that date is displayed. The resolved String should be the name of a date or dateTime format, which is then used to format the display.

If not defined, the default date format, if defined, is used for formatting instead. Otherwise the selected date is presented in an undefined format.

slds

Required

Value type

EL-evaluated

No

Boolean

Yes

If the resolved value of this attribute is true, the produced datepicker follows the Salesforce Lightning Design System (SLDS) theme in looks and functionality.

Examples

Creating a datepicker isn't complicated. Do note that the popup attribute changes the size of the picker quite a lot, so take that into account in your layout plans.  

CODE
<dyn-datepicker name="selectedDate" value="initialDate"/>
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.