luid-timespan

An input that display and edit a timespan in a user friendly manner but has a model value more easily usable by the js code.

Features

It is editable using a regex as pattern recognition to know if the inputed text is parsable into some kind of duration. If the pattern is invalid the binded value will be set to undefined. This allows the luid-timespan to be compatible with required and ng-required.

Upon pressing enter or losing focus of the input, it will format the input into a more readable form. For example you enter 140 and press enter, the text will change to 02h20

Supports up and down key events and scroll event to increment/decrement the value the value.

Supported arguments:

Usage

<luid-timespan ng-model="myValue"></luid-timespan>

myValue in luid-timespan (required) :

the value is required

myValue as it is in $scope :

Number of time ng-change on the luid-timespan has been called : {{updateCnt}}


With mode="moment.duration"

myDuration in the $scope : {{myDuration}} and with a luifDuration filter : {{myDuration | luifDuration}}


myValue2 bounded between "10m" and "11h" :

myValue2 as it is in $scope :