How to set Default Time in Touch UI Dailog | Community
Skip to main content
Level 4
July 21, 2016
Solved

How to set Default Time in Touch UI Dailog

  • July 21, 2016
  • 2 replies
  • 2916 views

Hi All,

    we have used date time xtype in Classic UI to get today date as default date using property defaultValue=now.

    But we are not able to set the default value in Touch UI using defaultValue=now

    Could you help us in assisting which property needs to be used for Touch UI.

    We are using slingResouceType as granite/ui/components/foundation/form/datepicker for Touch UI.

Regards

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

You need to code using JQuery with the following Granite data type: 

https://docs.adobe.com/docs/en/aem/6-0/develop/ref/granite-ui/api/jcr_root/libs/granite/ui/components/foundation/form/datepicker/index.html

Set the value property. 

To see an example of coding with this data type - see this blog. 

http://experience-aem.blogspot.ca/2015/12/aem-61-touchui-date-picker-validator-comparing-two-dialog-date-fields.html

This is a demo package too that you can install and look at. 

Hope this helps

2 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
July 21, 2016

You need to code using JQuery with the following Granite data type: 

https://docs.adobe.com/docs/en/aem/6-0/develop/ref/granite-ui/api/jcr_root/libs/granite/ui/components/foundation/form/datepicker/index.html

Set the value property. 

To see an example of coding with this data type - see this blog. 

http://experience-aem.blogspot.ca/2015/12/aem-61-touchui-date-picker-validator-comparing-two-dialog-date-fields.html

This is a demo package too that you can install and look at. 

Hope this helps

kautuk_sahni
Community Manager
Community Manager
July 22, 2016

Hi 

Couple of days back we had same question:

Link:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__l2wn-how_to_set_adefault.html

// use a component granite/ui/components/coral/foundation/form/datepicker instead of granite/ui/components/foundation/form/datepicker..

The only difference between your question and old post was their default date was needed and here time.

 

Other option is what Scott has mentioned:-

Create a custom component using Jquery and get the current value from it. To see an example of coding with this data type - see this blog. 

http://experience-aem.blogspot.ca/2015/12/aem-61-touchui-date-picker-validator-comparing-two-dialog-date-fields.html

This is a demo package too that you can install and look at. 

 

I hope this could help you.

Thanks and Regards

Kautuk Sahni

Kautuk Sahni
supriya-hande
Level 4
January 25, 2023

@kautuk_sahni I am having same issue. There is date field and want to set Default value as System date when user creates the article page. We are using this date field for sorting purpose. Any help here. Above links are not working for me.

Level 2
July 25, 2023

Hi @supriya-hande - We have a similar requirement. Please share if there are any details identified.

Thanks.