adding toString methiod to parseDate function becuase obj will always no be equal to 'Invalid Date'