Default value/variable for current date in DateInput field - Forum

Forum Navigation
You need to log in to create posts and topics.

Default value/variable for current date in DateInput field

Hi All,

May I know what is the default variable I can insert for current date into the DateInput's initial-value field. I tried putting [NAB.ShortDate] and it doesn't work. I used "SetVar [DateInputVar] [NAB.ShortDate]" and it doesn't work too. Any help is appreciated.

Thanks

Ronnie

Hi @ronnie,

I'm afraid managing dates it's not yet an easy task in VisualNEO Web (nor JavaScript).
You can use this code:

BeginJS
var now = new Date();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
$("#DateInput1").val(today);
EndJS

I will try to create a plugin with this library as soon as possible.
We are just scratching the surface about what will be possible to do with VisualNEO Web in the future :)
Regards.