We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think dayjs.max(dayjs('2018-01-01')) shoulde tobe dayjs('2018-01-01') instead of null
The text was updated successfully, but these errors were encountered:
in my case, i get many datestr containing null values,i just want the min/max one, but when only one isValid, i always get null.
// lss is an array having many datestr containing null values const essDayjs = lss.map(i => dayjs(i)).filter(i => i.isValid()) const lsMin = dayjs.min(...essDayjs) if (lsMin && lsMin.isValid()) return lsMin.format('YYYY-MM-DD HH:mm:ss') return null
I have to write bellow to get the results i want
const essDayjs = lss.map(i => dayjs(i)).filter(i => i.isValid()) if (essDayjs.length === 0) return null if (essDayjs.length === 1) return essDayjs[0].format('YYYY-MM-DD HH:mm:ss') const lsMin = dayjs.min(...essDayjs) if (lsMin && lsMin.isValid()) return lsMin.format('YYYY-MM-DD HH:mm:ss') return null
Sorry, something went wrong.
No branches or pull requests
I think dayjs.max(dayjs('2018-01-01')) shoulde tobe dayjs('2018-01-01') instead of null
The text was updated successfully, but these errors were encountered: