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

Odd date comparison calculation #2466

Open
elingamfelter opened this issue Oct 31, 2024 · 0 comments
Open

Odd date comparison calculation #2466

elingamfelter opened this issue Oct 31, 2024 · 0 comments
Labels
bug Something isn't working.

Comments

@elingamfelter
Copy link

What happened?

I am comparing the number of days between two dates. In the provided DQL snippet, the .days output jumps from 27 to 30 even though I only changed the date by 1 day.

It seems this is because the calculation goes from weeks to month (30 days).

Is there a better way to write this calculation?

DQL

`= date(2024-10-29) - date(2024-10-02)`        // 3 weeks, 6 days
`= (date(2024-10-29) - date(2024-10-02)).days` // 27

`= date(2024-10-30) - date(2024-10-02)`        // 1 month
`= (date(2024-10-30) - date(2024-10-02)).days` // 30

JS

No response

Dataview Version

0.5.67

Obsidian Version

1.7.4

OS

MacOS

@elingamfelter elingamfelter added the bug Something isn't working. label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

1 participant