Skip to content
New issue

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

Dayjs subtract does not support week based dayjs durations => expected? #2582

Open
yassuge opened this issue Feb 16, 2024 · 0 comments · May be fixed by #2583 or #2648
Open

Dayjs subtract does not support week based dayjs durations => expected? #2582

yassuge opened this issue Feb 16, 2024 · 0 comments · May be fixed by #2583 or #2648

Comments

@yassuge
Copy link

yassuge commented Feb 16, 2024

Describe the bug
Dayjs subtract does not support week based dayjs durations => expected?

x=dayjs()
x.toISOString()

'2024-02-16T12:14:02.958Z'

x.subtract(1,'weeks').toISOString()

'2024-02-09T12:14:02.958Z' // expected
x.subtract(dayjs.duration('P2W')).toISOString()
'2024-02-16T12:14:02.958Z' // !!! NO IMPACT => IS THIS NOT SUPPORTED?
x.subtract(dayjs.duration('P3M')).toISOString()
'2023-11-16T12:14:02.958Z' // expected

Information

  • Day.js Version dayjs@npm:1.11.10
  • OS: [e.g. iOS]
  • Browser [e.g. chrome 62]
  • Time zone: [e.g. GMT-07:00 DST (Pacific Daylight Time)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant