Sign in to Community
Sign in to view all badges
I'm currently facing a strange issue:
I've a component that includes text inputs and a date picker (Resource Type: granite/ui/components/foundation/form/datepicker).
I can add and edit values for all input fields and they are shown properly on the component on the edited webpage.
The system also stores all values properly.
But when I re-open the dialog the value for the date selected via date picker is not shown. The date picker input field remains empty.
All other inputs are prepopulated with the stored values.
The date is shown on the component but not in the date picker.
If I save the dialog with the empty date picker value the date will be overwritten with null.
Any idea what I can do to show the entered date there?
Thanks and best regards
Ah ok, you are using type="date" (the first property of your datepicker) this is what i meant.
I see your problem, you are using just type=date but by default this is storing in date-time format and thats why the dialog is not able to display the value.
1. If you want to retain type="date", have the additional property storedValue something like storedValue="YYYY-MM-DD" make sure you are not specifying time
2. change type="datetime", you don't need to specify the storedValue property in this case, and this lets you specify the time too.
Observe the content node for the stored value. You can use the properties accordingly for display purpose.