FormatDuration
Human-readable duration between two dates
import FormatDuration from "@intility/bifrost-react/FormatDuration";FormatDuration
Go to top
New in 6.10
Display human-readable duration between a start and end Date object, with a
tooltip displaying full datetime including time zone.
- Displays days if over 2: "7 days"
- Displays hours if over 2: "24 hours"
- Otherwise minutes: "30 minutes"
TSX
<FormatDuration start={startDate} end={endDate} />4 hours
Also see /react/examples/datepickerrange
Datepicker range demo with presets
Sandbox
7 days4 hours30 minutes