Skip to content

This package allows you to use moment-duration-format with bs-moment

Notifications You must be signed in to change notification settings

Anahkiasen/bs-moment-duration-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bs-moment-duration-format

This package allows you to use moment-duration-format with bs-moment.

Installation

npm install bs-moment bs-moment-duration-format # Or
yarn add bs-moment bs-moment-duration-format

Then update your bsconfig.json file accordingly:

"bs-dependencies": [
    "...",
    "bs-moment",
    "bs-moment-duration-format"
],

Usage

First you'll need to setup the integration somewhere where it will be executed, this registers the underlying Javascript method with Moment.js:

DurationFormat.setup();

Then in any other file:

open MomentRe;
open DurationFormat;

duration(30, `seconds) |> format("mm:ss") /* 30 */
duration(30, `seconds) |> formatWithOptions("mm:ss", options(~trim="small", ())) /* 01:30 */

About

This package allows you to use moment-duration-format with bs-moment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages