How to set today's date as Initial value for DateTextBox
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2015 06:38 AM
Hi All,
I have a widget shown below, I would like to set today's date as initial valuee while showing the widget in UI,
Even after setting the date in "value" field, it is not showing in the UI.
I will have to manually select the date, is there any way to populate the date with today's date.
Please help!!!!
Thanks in Advance,
Satheesh
I have a widget shown below, I would like to set today's date as initial valuee while showing the widget in UI,
var date = new Date();var lastDeployedToPROD = { name : "alfresco/forms/controls/DateTextBox", config : { requirementConfig : { initialValue : true }, value : date, name : "prop_hccm_lastDeployedDateToPROD" }};
Even after setting the date in "value" field, it is not showing in the UI.
I will have to manually select the date, is there any way to populate the date with today's date.
Please help!!!!
Thanks in Advance,
Satheesh
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2015 01:51 PM
Hi Satheesh,
Can you please try the below one?
This I have used, in the .get.js file.
Please let me know,if it is not helping you.
Can you please try the below one?
This I have used, in the .get.js file.
var currentDate = new Date().toISOString();//Create the form control for the studentvar formControls = [{ name : "alfresco/forms/controls/DojoValidationTextBox", config : { name : "alf_destination", value : alfDestination, visibilityConfig : { initialValue : false } } }, { name : "alfresco/forms/controls/DojoDateTextBox", config : { label : "Student Registration Date", value : currentDate, name : "prop_cm_studentRegistrationDate", requirementConfig : { initialValue : true } } }];
Please let me know,if it is not helping you.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2015 01:03 AM
It works like charm Murali. Thanks for you help.
I just changed my date assignment from
to
I just changed my date assignment from
var date = new Date();
to
var date = new Date().toISOString();
