This function starts with a duration (either by being directly passed a duration or by diffing
two dates into a duration) and converts that duration into a relative string like "1 month ago"
or "in 1 month". Rounding is automatically set to 0 decimal points, but that can be changed.
When extremely close to a 0 difference, the output string will be 'just now', which can be
disabled.
This function starts with a duration (either by being directly passed a duration or by diffing two dates into a duration) and converts that duration into a relative string like "1 month ago" or "in 1 month". Rounding is automatically set to 0 decimal points, but that can be changed.
When extremely close to a
0
difference, the output string will be'just now'
, which can be disabled.