We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
It doesn't seem to be possible to support micro relative timestamps. e.g. 4d 2h 5y 1m 6s
These are quite common in a variety of cases and with other libraries (e.g. timeago).
e.g.
const microTimeSince(date) { let seconds = Math.floor((new Date() - date) / 1000) let interval = seconds / 31536000 if (interval > 1) { return Math.floor(interval) + "y" } interval = seconds / 2592000 if (interval > 1) { return Math.floor(interval) + "m" } interval = seconds / 86400 if (interval > 1) { return Math.floor(interval) + "d" } interval = seconds / 3600 if (interval > 1) { return Math.floor(interval) + "h" } interval = seconds / 60 if (interval > 1) { return Math.floor(interval) + "m" } return Math.floor(seconds) + "s" }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It doesn't seem to be possible to support micro relative timestamps. e.g. 4d 2h 5y 1m 6s
These are quite common in a variety of cases and with other libraries (e.g. timeago).
e.g.
The text was updated successfully, but these errors were encountered: