i am trying to convert a string in the format dd-mm-yyyy into a date object in JavaScript using the following:
var from = $(\"#datepicker\").val(); var to
Another possibility:
var from = "10-11-2011"; var numbers = from.match(/\d+/g); var date = new Date(numbers[2], numbers[0]-1, numbers[1]);
Match the digits and reorder them