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
regular expression example:
new Date( "13-01-2011".replace( /(\d{2})-(\d{2})-(\d{4})/, "$2/$1/$3") );