Typescript Max Date In Array Function