A filter to display a timespan or a moment.duration
Will try to transform the input to a moment.duration, if the resulting duration is not valid, it will return nothing
The arguments for this filter are :
showSign: do you want 00h30 to appear as 30m or +30munit: when displaying 1h30, do you want it to appear as 1h30 or 90m. See below for supported unitsprecision: when displaying 1d 21h30m45.525s, how much precision do you want? Do you want to display 1d or 1d 21h30?And the supported units are:
{{ myValue | luifDuration : false : 'd'}} or 'day' or 'days'{{ myValue | luifDuration : false : 'h'}} or 'hour' or 'hours'{{ myValue | luifDuration : false : 'm'}} or 'min' or 'minute' or 'minutes'{{ myValue | luifDuration : false : 's'}} or 'sec' or 'second' or 'seconds'{{ myValue | luifDuration : false : 'ms'}} or 'millisec' or 'millisecond' or 'milliseconds'
{{ myValue | luifDuration }}
{{ myValue | luifDuration : showSign : unit : precision }}
Set myValue to
myValue : {{ myValue | luifDuration }}
myValue with unit='day': {{ myValue | luifDuration : false : 'd' }} - duration under the hour won't be displayed
myValue with unit='day' and precision='second': {{ myValue | luifDuration : false : 'd' : 's'}} - duration under the second won't be displayed
myValue with a sign: {{ myValue | luifDuration : true }}