blacksmithgu / obsidian-dataview Public
generated from obsidianmd/obsidian-sample-pluginNew 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
Bug report #715
Comments
|
I add this question: as |
|
That looks like a bug, and a very odd one at that. Perhaps I'm doing date-date subtraction or rendering incorrectly? |
|
Wish I had the brains to answer that question, but I don't. Thanks for looking at the issue. Angel |
|
I dug into this more and it turns out this is kind of complicated, but it's because Luxon considers '28 days', '30 days' and '31 days' to all be '1 month'; it also takes daylight savings time into consideration as well, which is a little annoying. This seems like a very tricky fix; I underestimated how difficult durations are to work with! I'll have to think on this a little more on how to make it ergonomic. |
|
Understand the explanation. Gulp. Very tricky. Thanks for looking into it. Angel |
|
I noticed today that a simple count of just days in isolation (no years, months, or weeks) leads to a miscalculation in DV. DVJS appears to get it right. Don't know if this is related or helpful, but ... https://forum.obsidian.md/t/how-to-calculate-duration-between-dates-in-dataview/31225/14 Angel |
What happened?
The table below is using a duration query to work out the amount of time elapsed since a specific start date: 2021-10-19
When parsed, the query says 15 November is 3 weeks and 6 days since the start date.
It then says that 16 November is 1 month since the start date.
It then says that 17 November is 1 month and 1 day since the start date.
It then says that 18 November is 1 month since the start date.
It then says that 19 November is also 1 month since the start date.
It then says that 20 November is 1 month and 1 day since the start date.
Am I doing something wrong or is this a bug?
Thanks
Angel
DQL
JS
No response
Dataview Version
0.4.21
Obsidian Version
0.12.19
OS
MacOS
The text was updated successfully, but these errors were encountered: