Closed titpetric closed 9 years ago
Reading the code a bit, the change with the least impact would be to pass a function as the value of 'prettify', and then override the internal prettify callback, which is already used everywhere.
if (typeof settings.prettify === "function") {
prettify = settings.prettify;
}
This would go somewhere around js/ion.rangeSlider.js#L306, I just tested it myself. If you want I can fork and push back the changes, if this way is good with you?
Best, Tit
Hi, it is very good idea, but it will need much tests, so maybe in 2.0
^^ so far it's been working for me.
prettify: function(val) {
return moment().startOf('year').seconds(val).format("H:mm:ss.SS");
},
Of course, but it is your patch))
This should be included in 2.0 , after applying:
if (typeof settings.prettify === "function") {
prettify = settings.prettify;
}
I could make it look like this:
I think i will include this.
Hi, in 2.0 you can replace prettify function and work with dates.
I'm looking to make a slider which will be time based. I want to use time stamps (seconds, milliseconds) as the sliding values. The output doesn't fit the current conventions however. A callback which would convert the raw integer/float value to a readable output would be needed.
For example: Slider from 0 to 3600, want to print MM:SS values for this (01:12-45:30, 00:00 - 59:59). Slider from 1388530800 to 1391209200 (January 1st 2014 - February 1st 2014).
A callback would be needed for this. I'm not familiar enough with the plugin to suggest a "valid" way or name how to pass this callback to it however. Maybe "toReadable" : function(value) ...
Best, Tit