setting datetime default
setting datetime default
javismiles
Posts: 205Questions: 38Answers: 3
in Editor
I have a datetime field and I want to set its default value to be the current date and time for when u create a new record,
I try it all but it doesnt work, no errors, it just puts whatever it wants
if (obj.t=="datetime"){
fieldobj[index] = {
label: obj.d,
name: obj.i,
className: obj.c,
type: "datetime",
def: function () {
console.log("set def");
vnew=new Date();
return vnew;
//return new Date("2018-02-05 12:08:00");
},
format: 'YYYY-MM-DD HH:MM:SS',
fieldInfo: 'Euro style date with 24 hour clock...'
};
This discussion has been closed.
Answers
my...
format: 'YYYY-MM-DD HH:mm:ss',
its the mm and ss lowercase....
we can close this, thank u