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 |