I am receiving data from a datetimepicker in the format "14-02-2018" as a string value. I need to parse this value into a date object. I attempted to do it like this:
new Date(Date.parse('02-03-2018))
However, this only works if the format is '2018-03-02'. I also tried using Moment.js but encountered an issue with parsing:
var aaa = moment(itemvalue, "DD-MM-YYYY");