Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

how to use date time picker to select particular time and display the time selected in the front end in HH:MM:SS format

kattakiran1990
Level 1
Level 1

Hi,

 

Our requirement is to provide a time window for the user to access a offer how can i achieve this functionality using AEM component. kindly suggest.

 

Thanks in advance  

1 Accepted Solution
Bhuwan_B
Correct answer by
Community Advisor
Community Advisor
0 Replies
Bhuwan_B
Correct answer by
Community Advisor
Community Advisor
Vijayalakshmi_S
Community Advisor
Community Advisor

Hi @kattakiran1990,

You can use the type as datetime or time and control the formatting in HTL (as you might have issues in persistence when using valueFormat as HH:mm:ss)

Vijayalakshmi_S_1-1636487013002.png

In HTL : ${'HH:mm:ss' @ format = properties.date}

Kiran_Vedantam
Community Advisor
Community Advisor

Hi @kattakiran1990 

 

Here is the xml code for you

 

<createdDate
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/datepicker"
allowBulkEdit="{Boolean}true"
displayedFormat="MM/DD/YYYY HH:mm:ss"
disabled="{Boolean}true"
displayTimezoneMessage="{Boolean}true"
fieldLabel="Created Date"
fieldDescription="MM/DD/YYYY"
name="./jcr:created"
type="date"/>

 

Hope this helps!

 

Thanks,

Kiran Vedantam.