I try to apply arguments to Date, but its not work. How I can apply arguments to native constructor Date? I tried:
var a = new (Date.bind.apply(Date, ['2010-10-10']))();
and
var a = new Date();
Date.apply(a, ['2010-10-10']);
I try to apply arguments to Date, but its not work. How I can apply arguments to native constructor Date? I tried:
var a = new (Date.bind.apply(Date, ['2010-10-10']))();
and
var a = new Date();
Date.apply(a, ['2010-10-10']);
If the parameter you are using defines a specific date, just use the usual new Date()
constructor:
var a = new Date( '2010-10-10' );