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? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Describe the bug
Take this example to illustrate why I might end up calling with a single arg:
const list = myApiResponse.data; const minCreatedDate = dayjs.min(dayjs.utc(createdDate), ...list.map((item) => item.createdDate))
When list is empty, dayjs.min returns null.
list
dayjs.min
However, if you instead pass these args as a list to dayjs, we get the expected result:
const minCreatedDate = dayjs.min([ dayjs.utc(createdDate), ...list.map((item) => item.createdDate ])
^ this returns the createdDate as expected
createdDate
Expected behavior
When dayjs.min() is passed a single argument, it should still return a result if the argument is a valid date.
dayjs.min()
Information
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Take this example to illustrate why I might end up calling with a single arg:
When
list
is empty,dayjs.min
returns null.However, if you instead pass these args as a list to dayjs, we get the expected result:
^ this returns the
createdDate
as expectedExpected behavior
When
dayjs.min()
is passed a single argument, it should still return a result if the argument is a valid date.Information
The text was updated successfully, but these errors were encountered: