Added function for checking the date format