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
For checking date format you could use:
moment(checked_date, DATE_FORMAT).format(DATE_FORMAT) === checked_date