Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Assign Input Type of Date

I am struggling with this simple thing. I have an input control on my page with type=date. On page load i would like to set it = to the current date.

I am using the following code that just does not work.

var today = new Date();

Appery ("BatchHdr_StopDate").val(today.toISOString ());

I have also tried;
Appery ("BatchHdr_StopDate").val(today);

I cannot get this to work. Any ideas?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Assign Input Type of Date

Hi Roger,

Use the following code please:prevar today = (new Date()).toISOString();
Appery("mobiletextinput_3").val(today.split("T")[0]);/pre

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Assign Input Type of Date

Katya,

That worked...THANK YOU!!

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Assign Input Type of Date

Katya,

For this input type of date how do I set a format so that when the native control (iOS) is displayed it shows the day of the week? Right now it just shows Month, day and year.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Assign Input Type of Date

Hi Roger,

Please read this: http://stackoverflow.com/questions/73...

If this issue is critical for your app, you can use "DatePicker" component that's allow to set date format.

Regards.

Roger
Posts: 0
Joined: Fri Mar 29, 2013 1:10 pm

Assign Input Type of Date

thanks for the info. We are actually moving away from the datepicker as it is tedious to use on a mobile device.

Return to “Issues”