The article that explains how to do this is no longer available...
The article that explains how to do this is no longer available...
Add javascript code on screen load:
precode
var currDate = new Date();
$('div[dsid="mobiledatepicker1"] input').val((currDate.getMonth()+1)+'/'+currDate.getDate()+'/'+currDate.getFullYear());
/code/pre
Make sure the component is called 'mobiledatepicker1' or use whatever name you set.
I used this code, and it shows the date. However, when I click on search nothing appears. I would have to then manually click on calender, and select the same date. So, I have on click set local storage variable which is the date. However, even though the correct date is in the box, it's not recognizing it when it's showing today's date.
Hello Mike,
Please show us screen shot.
Please note, by default datepicker component displays current today date http://devcenter.appery.io/documentat...
Hi Mike,
Following code works for me:
pre
//Create date. You can set here the date you need.
var currDate = new Date();
//Note: you should replace "mobiledatepicker_132" with your datepicker component.
$('div[dsid="mobiledatepicker_132"] input').val((currDate.getMonth()+1)+'/'+currDate.getDate()+'/'+currDate.getFullYear());
console.log("Set date for datepicker component as = '" + (currDate.getMonth()+1)+'/'+currDate.getDate()+'/'+currDate.getFullYear() + "'");
/pre
So you can run this code on "page show" event and do not care about default date in component properties.
Regards.
Worked like magic ! Thank you Yurii.
Hi Mike,
Can not understand your problem.
Please give us more details.
Regards.