I have a text box that is populated from a datepicker in Javascript. The date is stored as 30-Jan-2013
. I want to convert this to a date so I can use it in other calculations.
I have tried
var date1 = new Date(document.getElementById('textbox').value)
but this returns Nan
if I drop the new Date
part e.g.
var date1 = (document.getElementById('textbox').value
I get the date 30-Jan-2013
I just don't seem to be able to convert this?