Does anyone know of a good *time interval* / range library?
In Lemmy, we've removed the TopSixHours / TopXTime in favor of a more fine grained time_range_seconds field. You can see it in action in this PR
The problem is, we need a good UI picker for a time interval: IE things like 5 seconds, 4 days, 7 months, etc.
I've found a million libraries for specific date and time pickers, but not a single one for time intervals.
Does anyone know of any?
Thanks in advance.
Adding post time filtering with defaults. by dessalines · Pull Request #3403 · LemmyNet/lemmy-ui
Fixes More specific time filtering #2187 Description Adds the default_post_time_range_seconds day range select to your user settings. This is extracted into a component that uses days by default....GitHub
Nutomic likes this.
mark
in reply to Dessalines • • •intervalToDurationfunction of the date-fns lib could help with this though. There's alsoformatDurationwhich may be helpful.Modern JavaScript Date Utility Library
date-fns.orgDessalines
in reply to mark • • •How to convert seconds to biggest significative time unit
Stack Overflow