Salta al contenuto principale


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.

in reply to Dessalines

Probably due to it being a rare use-case. Sounds like you need durations, which are usually expressed as the timeframe between two dates. Perhaps the intervalToDuration function of the date-fns lib could help with this though. There's also formatDuration which may be helpful.
Questa voce è stata modificata (3 mesi fa)
in reply to mark

I ended up figuring it out by using this simple pseudocode.

Questo sito web utilizza cookie tecnici e di sessione. Proseguendo la navigazione su questo sito, accetti l'utilizzo dei cookie.