Implemented dateCheck() function.