How to initialize the value for Input Date Picker component

1060
3
Jump to solution
09-27-2022 12:20 AM
baohuachu2
New Contributor II

setting value, start or end not succeed.

0 Kudos
1 Solution

Accepted Solutions
KittyHurley
Esri Contributor

The "value" property value will vary when the component also has range enabled. 

Here's a Codepen sample that includes both with and without a range set on the calcite-date-picker component.

Where without a range the value can be set to "YYYY-MM-DD", and with range set on the component the values reside inside an array, such as  ["YYYY-MM-DD", "YYYY-MM-DD"].

View solution in original post

3 Replies
FC_Basson
MVP Regular Contributor

Hi

Are you using the latest release (1.0.0-beta.94)?  The "start" and "end" properties have been deprecated  and should be replaced with "min" and "max" properties.

https://developers.arcgis.com/calcite-design-system/components/date-picker/#api-reference

 

<calcite-date-picker min="2022-01-01" max="2022-12-31" value="2022-09-27"></calcite-date-picker>

 

 

 

baohuachu2
New Contributor II

Hello FC_Basson ,

   For the date pickers with range type , how to set the default values?  See the code pen, the "value" property works for no range type. 

0 Kudos
KittyHurley
Esri Contributor

The "value" property value will vary when the component also has range enabled. 

Here's a Codepen sample that includes both with and without a range set on the calcite-date-picker component.

Where without a range the value can be set to "YYYY-MM-DD", and with range set on the component the values reside inside an array, such as  ["YYYY-MM-DD", "YYYY-MM-DD"].