Full documentation
install:
npm i @plasma-platform/clock-timer -S
- ClockTimer
- ClockTimer
- ClockTimer
- init
- updateTimer
- getChangedValues
- init
- updateTimer
- getChangedValues
- start
- stop
- calculateTime
- tick
- mergeDeep
Creates CNT1A promotion timer
Creates CNT1C promotion timer
clock-timer model
Initializes the timer
-
args
Object-
args.locale
string timer locale -
args.count
number? Quantity of ticks for 'counter' timerFace type. -
args.timerFace
string Timer type (daily | hourly | counter). 'daily' by default -
args.timerName
string Unique name for the timer -
args.startTimeStamp
number? Timer start date -
args.endTimeStamp
number Timer end date -
args.direction
string Timer count direction ('decrement' | 'increment') // TODO: implement direction behaviour
-
updates timer value(s)
-
changedTime
Object timer changed values -
timerId
number generated id to distinguish which timer to update
Returns boolean
Compares new and old date and decides which values to change
-
newTime
Object new time object
Returns Object Values to be changed
Initializes the timer
-
args
Object-
args.locale
string timer locale -
args.count
number? Quantity of ticks for 'counter' timerFace type. -
args.timerFace
string Timer type (daily | hourly | counter). 'daily' by default -
args.timerName
string Unique name for the timer -
args.startTimeStamp
number? Timer start date -
args.endTimeStamp
number Timer end date -
args.direction
string Timer count direction ('decrement' | 'increment') // TODO: implement direction behaviour
-
updates timer value(s)
-
changedTime
Object timer changed values -
timerId
number generated id to distinguish which timer to update
Returns boolean
Compares new and old date and decides which values to change
-
newTime
Object new time object
Returns Object Values to be changed
Start clock-timer
Stops clock-timer
Calculates initial time
-
intervalTime
number Interval time (for setInterval function)
Returns (Object | number) 'time' object or 'count' (depends on 'timerFace' property)
Function to be executed every timer tick. Calculates new time or count
-
intervalTime
number clock-timer interval in milliseconds
Returns boolean
Merges objects
Returns object