`toRelativeCalendar` doesn't really work like you'd expect
See original GitHub issueThis is a little funny:
base = DateTime.local(2018, 12, 31);
base.plus({ days: 1 }).toRelativeCalendar({base}) //=> "next year"
This is technically correct, but I suspect most people would want that to say “tomorrow”. Same issue with the end of months.
The question is: when should it say next year?
- whenever it is next year? (current behavior)
- never?
- When it’s over 1 year in the future? (this is pretty weird IMO; in our 12/31 example, it would only say “next year” for one day at the end of next year")
- when it’s over N months in the future? For what N?
Same problem for months. And I haven’t even introduced weeks, which is surely similar.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:10 (1 by maintainers)
Top Results From Across the Web
luxon 3.1.1 | Documentation
To create one from a native JS date, use DateTime.fromJSDate. Gregorian calendar and time: To examine the Gregorian properties of a DateTime individually...
Read more >The Complete Guide to Day.js - Mirza Leka - Medium
Basically, it allows us to pass the date format and locale into the Day.js object. import * as customParseFormat from 'dayjs/plugin/ ...
Read more >datetime - Calculate relative time in C# - Stack Overflow
As time passes, the timestamps will automatically update. ... called Humanizr on Nuget, and it actually works really well, and is in the...
Read more >Reviews: Zookeeper - IMDb
A family comedy that doesn't work ... The Waterboy and Click, all starring Adam Sandler, to relative duds like Around the World in...
Read more >Publication 523 (2021), Selling Your Home - IRS
Effective December 22, 2017, section 1400Z-2 provides a temporary ... as time you lived at home (even if you rented out your home...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, we need a spec. I like the idea that the threshold matches the size of the unit. I don’t like the idea of overrides because I think it would be a confusing API. We can always add it later but we can’t take it back once we do. So I’d like to make this change without expanding the API surface area.
I don’t think this really requires a major version bump, either.
It happens with me also … Is there any plan to fix it?