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
new Date().toLocaleDateString();
simple as that, just pass your date to js Date Object