Validated the date(s) with particular format.