Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

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

Avatar

Level 4

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.

 

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 10

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...

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

Selection_194.png

The resulting value saved in the field:

Selection_195.png

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

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...

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

Selection_194.png

The resulting value saved in the field:

Selection_195.png

Avatar

Administrator
Great answer. Very well written.


Kautuk Sahni