I am taking input from calendar in my screen which is of this type
DD-MMM-YYYY HH:mm a
but user can provide date from keyboard. Now I have to
This is much better:
if (!moment(checked_date, DATE_FORMAT).isValid()) throw Error(Argument passed is invalid: checked_date. Date format must be ${DATE_FORMAT});
Argument passed is invalid: checked_date. Date format must be ${DATE_FORMAT}