Hi,
Is there any way I can extend/redefine the Counter component to make it as a Time counter with the following format in the display:
hh : mm
i.e 12:05
And every time a user wants to step back/over by clicking on the +/- buttons, the time is incremented by a predefined step value?
Pipe
Element wasn’t purposed for such use-case, but with a bit of code you can change how it renders the data
dhx.ui.passive.counter.set_value = function(node, value, obj){
value = Math.floor(value/60)+":"+(value%60);
this.get_input(node).innerHTML = value;
};
dhx.ui.passive.counter.get_value = function(node, obj){
var data = this.get_input(node).innerHTML.split(":");
return data[0]*60+data[1]*1;
};
Sample is attached
counter_0_6.ZIP (70.2 KB)