date_time_picker icon indicating copy to clipboard operation
date_time_picker copied to clipboard

Trying to set initial values is giving unexpected results

Open tiloc opened this issue 3 years ago • 2 comments

I am trying initialize the date_time_picker with the following parameters: type: DateTimePickerType.date initialTime: null initialDate: 1972-11-30 00:00:00.000 initialValue: 11/30/1972

locale is "en_US".

Expected outcome: I am expecting it to initialize with '11/30/1972' in the input field.

Actual outcome: Instead, it initializes with todays date.

tiloc avatar Apr 02 '21 00:04 tiloc

hard coded initialValue: '1996-05-16 14:07:00' works but if we set it dynamically it does NOT work. Any suggestion, will be highly appreciated. Thanks.

kamleshwebtech avatar May 20 '21 15:05 kamleshwebtech

initialTime and initialData is just to set clock picker and calendar picker if initialValue was null, otherwise, it will use the initialValue. So, as you set initialValue, initialDate will be ignored. Now, in this case initialValue neet aways be YYYY-mm-dd format.

hslbetto avatar Jul 08 '21 02:07 hslbetto