I have a page with a series of variables that contain a date in string format (yyyy-mm-dd) , which comes from using the .js moment.
Is there a way to pass such a variable to a Javascript or date object. convert it to a javascript date object? I'm not interested in the time until I can get a date converted to a date object that would be great.
I tried the following, but this does not work, and I could not find a way using moment.js:
var newVar = new Date(dateVar);
Thanks so much for any help with this, Tim.
javascript jquery datetime momentjs date-arithmetic
user2571510
source share