Skip to content

dur() calculation is wrong for dates almost a year apart #2562

Open
@StephSabel

Description

@StephSabel

What happened?

Image
Image

The duration between today (April 17th 2025) and April 15th 2026 is calculated as 366 days, which is more than a year.
The duration between today and a year from now (April 17th 2026) is correctly calculated as 365 days

The calculation in years using .year gives a result of over a year as well.

Image
Image

DQL

TABLE WITHOUT ID

dur(date("2026-04-15") - date("2025-04-17")).year as "years until 2026-04-15",

durationformat(dur(date("2026-04-15") - date("2025-04-17")), "d") as "days until 2026-04-15",

durationformat(dur(date("2026-04-17") - date("2025-04-17")), "d") as "days until 2026-04-17"

FROM #example

JS

Dataview Version

0.5.67

Obsidian Version

v1.8.9

OS

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions