Obviously, the code was targeted for nuBuilder Pro. nuFormatDateByString() is not defined in v4. Is there a similar function to format a date?var d = $("#the_date").attr('data-nuformat');
var f = nuFormats[d].format
$("#the_date").val(nuFormatDateByString(new Date(), f));
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
nuFormatDateByString
nuFormatDateByString
I'm trying to set a Default date using the format that has been set in the Format Builder. I came across this: https://forums.nubuilder.cloud/viewtopic. ... dar#p13786
Re: nuFormatDateByString
Timo,
You could try this...
Steven
You could try this...
Code: Select all
function format_the_date(){
var f = $('#the_date').attr('data-nu-format') //-- "D|dd-mmm-yyyy"
var d = new Date();
var s = d.getFullYear() + '-' + nuPad2(d.getMonth() + 1) + '-' + nuPad2(d.getDate());
var f = nuFORM.addFormatting(s, f);
return f;
}
Steven