Hi,
I'd like to edit some questions containing the NoUISlider.
In particular to be able to access the format property of the noUISlider options to do something like this:
JavaScriptvar aproximateHour = function (mins){
if (mins >= 1440) {
mins -= 1440;
}
var minutes = Math.round(mins % 60);
if (minutes == 60 || minutes == 0) { return mins / 60;}
return Math.trunc (mins / 60) + minutes / 100;
}
noUiSlider.create(noUISliderItem, {
start : 240,
behaviour: 'tap-drag',
step: 15,
tooltips: true,
range : {'min': 1200, 'max': 1620},
format: wNumb({
decimals: 2,
mark: ":",
encoder: function(a){
return aproximateHour(a);
}
}),
pips: {
mode : 'steps',
format: wNumb({
decimals: 0,
encoder: function(a ){
return aproximateHour(a);
}
}),
filter : filter_hour,
stepped : true,
density:4
}
});
function filter_hour(value, type) {
return (value % 60 == 0) ? 2 : 0;
}