put back static_Cast of year to int for check if date is valid