I think dayjs.max(dayjs('2018-01-01')) shoulde tobe dayjs('2018-01-01') instead of null 