Fix invalid date in angular