ng-luxon-duration
Pipes for use and format Luxon Duration
in Angular (2+)
Installation
Node.js
npm install ng-luxon-duration
Usage
Import LuxonDurationModule
into your app's modules:
;
This makes all the ng-luxon-duration
pipes available for use in your app components.
Available pipes
aldFromISO
pipe
Create a Duration from an ISO 8601 duration string. Accepts same optional opts
parameter as Duration.fromISO
.
Example:
aldFromMillis
pipe
Create a Duration from a number of milliseconds. Accepts same optional opts
parameter as Duration.fromMillis
.
Example:
aldFromObject
pipe
Create a Duration from a Javascript object with keys like 'years' and 'hours'. See Duration.fromObject
for more details about the keys and the accepted options.
Example:
aldToFormat
pipe
Returns a string representation of this Duration formatted according to the specified format string. Accepts same optional opts
parameter as Duration.fromISO
.
Example:
aldToISO
pipe
Returns an ISO 8601-compliant string representation of this Duration.
Example:
License
Released under the terms of the MIT License.