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
if it's just for checking the below is a better alternative
moment(scope.modelValue, 'DD-MMM-YYYY HH:mm a', true).isValid()