Want to save datepicker value to specific format (YY-MM-DD) | Community
Skip to main content
khamat_bn
Level 4
Jun 22, 2020 4:20 PM UTC
Solved

Want to save datepicker value to specific format (YY-MM-DD)

Hi Folks ,

 

I have used datepicker in the dialog and it's saving the values in 2020-06-22T00:00:00.000+05:30 like format. 

I want to save the date value in (YY-MM-DD) format.

I have used granite/ui/components/coral/foundation/form/datepicker.

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Theo_Pendle
Theo_PendleAccepted solution
Level 8
Jun 22, 2020 4:50 PM UTC

Hi @khamat_bn,

Yes, you can provide a format using the valueFormat property. See the docs here: https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/datepicker/index.html

Here is an example where I set the format to YYY-MM-DD. The datepicker node:

The resulting value saved in the field:

2 replies

Theo_Pendle
Theo_PendleAccepted solution
Level 8
Jun 22, 2020 4:50 PM UTC

Hi @khamat_bn,

Yes, you can provide a format using the valueFormat property. See the docs here: https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui/api/jcr_root/libs/granite/ui/components/coral/foundation/form/datepicker/index.html

Here is an example where I set the format to YYY-MM-DD. The datepicker node:

The resulting value saved in the field:

Translate
kautuk_sahni
Employee
Jun 23, 2020 8:21 AM UTC
Great answer. Very well written.
Translate
Kautuk Sahni