Hi i have a variable result of some function with string in a date format (mm-dd-yyyy). I need to convert this string to date in same format like String "23-11-2016" should be converted to Date as 23-11-2016. I dont want any hours or minutes just date like 23-11-206 as i need to pass it to another function. i Have tried all solutions but nothing worked. some lines of code from my script are as follows
date2 = calendar_page.verifyNthDay(today);
//date2 = 23-12-2016
var date_two = new Date(date2);
console.log(date_two);
//Output shows as Invalid Date on console.