So, I have two variables and one function:
function addDays(date, days) {
var result = new Date(date);
result.setDate(result.getDate() + days);
return result;
}
const dateToCompare=moment.utc(endDate).format('DD-MM-YYYY')
const maximum=moment.utc(addDays(new Date(),14)).format('DD-MM-YYYY')
However, I do not know how to compare them, since they are now formatted as strings, but at the same time new Date(dateToCompare) doesn't work.
Can someone give me a hint?