Datepicker default date Today
Please try add ")" at the end of code, you have missed it.
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/
Please try add ")" at the end of code, you have missed it.
wow. great. thanks a lot!
Good Day
Using this method, how can i set the default date to the first day of the year,
I thought of changing the
new Date()
by something like something like this:
var dateElement = Appery("todate");
var currDate = new Date();
...
dateElement.setProperty("defaultDateValue", $.datepicker.formatDate(dateElement.datepicker_dataPickerOptions.dateFormat, '01/01/'+currDate.getFullYear()));
What am I doing wrong please
Thanks
Daniel
Hello! In $.datepicker.formatDate with a second parameter you have to pass not string, but object Date. If you have for datepicker the following Date Format mm/dd/yy
or
dd/mm/yy
Try this code prevar dateElement = Appery("todate");
var currDate = new Date();
dateElement.setProperty("defaultDateValue", '01/01/'+currDate.getFullYear());/pre
Hello.
I am using Maryna suggestion and it works great. Can you tell me how I would add days (+ 5) to the current date using this?
var dateElement = Appery("date");
dateElement.setProperty("defaultDateValue", $.datepicker.formatDate(dateElement.datepicker_dataPickerOptions.dateFormat, new Date()));
Hi John,
Use this code please: prevar d = new Date(Appery("mobiletextinput").val());
d.setDate(d.getDate() + 5);
Appery("mobiletextinput").val(d.getYear + "-" + d.getMonth() + "-" + d.getDate());/preWhere 'mobiletextinput' is a name of date input component.
Sorry. That did not work. Just freezes
Hi John,
Try this code please: prevar d = new Date(Appery("mobiletextinput").val());
d.setDate(d.getDate() + 5);
var dd = d.getDate();
var mm = d.getMonth()+1; //January is 0!
var yyyy = d.getFullYear();
if (dd < 10) {dd='0'+dd}
if (mm < 10) {mm='0'+mm}
mydate = yyyy+'-'+mm+'-'+dd;
Appery("mobiletextinput").val(mydate);
/preWhere 'mobiletextinput' is a name of date input component.
This code will increase current date component value by 5 days.
The script runs but it does not set the date.
Hi John - are there any errors in the console?
You can also try to debug the code - to see what values are passing.
:: http://docs.appery.io/documentation/d...