Implemented a function to determine the date of the task to know which list it should be added