From 7208ec491fd6dd54f7bd86698bf2620ea79c963f Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 06:53:55 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Documentation=20auto-update?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/utils/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/utils/README.md b/packages/utils/README.md index c8f9e4c3a..e2143a34f 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -49,6 +49,7 @@ npm i @dfinity/agent @dfinity/candid @dfinity/principal - [encodeBase32](#gear-encodebase32) - [decodeBase32](#gear-decodebase32) - [bigEndianCrc32](#gear-bigendiancrc32) +- [secondsToDuration](#gear-secondstoduration) - [debounce](#gear-debounce) - [isNullish](#gear-isnullish) - [nonNullish](#gear-nonnullish) @@ -234,6 +235,20 @@ Parameters: [:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/utils/src/utils/crc.utils.ts#L61) +#### :gear: secondsToDuration + +Convert seconds to a human-readable duration, such as "6 days, 10 hours." + +| Function | Type | +| ------------------- | ----------------------------- | +| `secondsToDuration` | `(seconds: bigint) => string` | + +Parameters: + +- `seconds`: - The number of seconds to convert. + +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/utils/src/utils/date.utils.ts#L10) + #### :gear: debounce | Function | Type |