You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dayjs().weekday(5) // next Friday (5th day after Sunday)
Today, Sunday, it behaves like this:
dayjs().format('YYYY-MM-DD')
'2022-08-21'
dayjs().isoWeekday(7).format('YYYY-MM-DD')
'2022-08-21' // correct, first possible Sunday is today.
dayjs().isoWeekday(5).format('YYYY-MM-DD')
'2022-08-19' // bug. Next or first possible Friday is on 08-26. If I wanted the previous Friday, I would have used dayjs().isoWeekday(-5)
Information
Day.js Version "version": "1.11.4",
OS: linux
Browser chrome 102
Time zone: GMT+2
The text was updated successfully, but these errors were encountered:
Describe the bug
isoWeekday(x) doesn't get next day of week, but previous, at least when that day already passed
Expected behavior
Similar to https://day.js.org/docs/en/get-set/weekday
Today, Sunday, it behaves like this:
Information
The text was updated successfully, but these errors were encountered: