Skip to content

Commit 739ae39

Browse files
Oneday12323Planeshifter
authored and
Utkarsh Gupta
committed
docs: improve time/base README Examples
PR-URL: stdlib-js#1657 Resolves: stdlib-js#1653 --------- Signed-off-by: Philipp Burckhardt <[email protected]> Co-authored-by: Philipp Burckhardt <[email protected]> Reviewed-by: Philipp Burckhardt <[email protected]>
1 parent c0e5361 commit 739ae39

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: lib/node_modules/@stdlib/time/base/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ var objectKeys = require( '@stdlib/utils/keys' );
7676
var ns = require( '@stdlib/time/base' );
7777

7878
console.log( objectKeys( ns ) );
79+
80+
// Parse a duration string
81+
var obj = ns.parseDuration( '1m3s10ms' );
82+
// returns { 'days': 0, 'hours': 0, 'minutes': 1, 'seconds': 3, 'milliseconds': 10 }
83+
84+
obj = ns.parseDuration( '1m3s' );
85+
// returns { 'days': 0, 'hours': 0, 'minutes': 1, 'seconds': 3, 'milliseconds': 0 }
7986
```
8087

8188
</section>

0 commit comments

Comments
 (0)