Replies: 1 comment
-
|
The documentation is a bit outdated in this regard. A closer equivalent to Moment's const now = DateTime.now();
const tomorrow = now.plus({days: 1});
console.log(tomorrow.toRelative({ base: now })); // in 1 dayWith Luxon exposes something similar to Another possible addition would be something like I'll look into updating the documentation. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I honestly haven't used the package before (this will be my first time) but I was looking through docs and found this line
Luxon does not (yet) have an equivalent of Moment's Duration humanize method. Luxon will add that when Intl.UnitFormat is supported by browsers.
Luxon Docs - For Moment users
I had a look around and that link hasn't had an update for 8 years.
Searching further, I found Intl.DurationFormat which seems to be a new 2025 thing and supported by all major browsers, and via my basic look, seems to meet the humanize objective...?
So was hoping to pop this onto the feature request list again please.
Beta Was this translation helpful? Give feedback.
All reactions