Fixed the date functionalities