Added function to check if date is written correctly