set default on datepicker
Hi there,
is it possible to have todays date as default, unless clicked and another date selected
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Hi there,
is it possible to have todays date as default, unless clicked and another date selected
You should be able to do it via JavaScript. Get today's date and set it on page load.
Hi Max,
when you say via javascript is this what you mean
var current_date = new Date();
var dd = current_date.getDate();
var mm = current_date.getMonth()+1; //January is 0!
var yyyy = current_date.getFullYear();
also I notice in the new builder the datepicker shows on load NaN/NaN/NaN
Yes, something like this.
You get NaN/NaN/NaN -- when you use JavaScript or without it?
with and withoutMax, running the code above had no impact on new or old builder
any idea whats happening with this datepicker Max,
Still getting NaN on new builder, with or without any extra code, various codes had no effect
(could it not be default to display todays date as this has got to be the most used format, you cannot book anything for yesterday
Hello! Looks like a bug. We'll fix it.
I am also getting it as well as no Javascript:alert() on success of service.
Since this is the first hit in google i'm putting the full code i got working here
//set picker on load so it doesnt show NaN
var current_date = new Date();
var dd = current_date.getDate();
var mm = current_date.getMonth()+1; //January is 0!
var yyyy = current_date.getFullYear();
$('input[type="text"]').val(mm+"/"+dd+"/"+yyyy);
-----//access elements of the date in some other code
var dateArray = $('input[type="text"]').val().split('/');
var mm = dateArray[0];
var dd = dateArray[1];
var yyy = dateArray[2];