Version: v4.8.0
use-time-ago
#
AboutA React Hook to get time ago for timestamp millisecond value.
#
Installation#
Importing the hook#
Usage#
ArgumentsArgument | Type | Description | Default value |
---|---|---|---|
input | Date | Timestamp | etc |
options | Object | Options object | { intervalMs:0 } |
#
OptionsOptions | Type | Description | Default value |
---|---|---|---|
intervalMs | milliseconds | Duration after which time-ago has to be calculated | 1000 |
locale | String | Locale in which value is expected | undefined |
relativeDate | Date | Relative date object with respect to which time-ago is to be calcuated | Current Time |
#
Returned ValueTimeago string is returned.
#
Join Bhargav's discord serverYou can click on the floating discord icon at the bottom right of the screen and talk to us in our server.