0

I have tried to use a plugin JQRangeslider to make a datetime filter, but the label of the filter only showed date, but not time. I checked the documentation, but it didn't tell me how to do.

And this is the documentation of jQRangeSlider

http://ghusse.github.io/jQRangeSlider/options.html

Desmond Lai
  • 35
  • 1
  • 5

1 Answers1

0

You can use formatter configuration option to write your format method.

Like this

$("#slider").dateRangeSlider({
    formatter: function(v){
    return v.toUTCString();
  },
  bounds: {min: new Date(2012, 0, 1, 10,30,10), max: new Date(2012, 11, 31, 12, 59, 59)},
    defaultValues: {min: new Date(2012, 1, 10), max: new Date(2012, 4, 22)},
    step:{days:2}
});
wuxiandiejia
  • 851
  • 1
  • 10
  • 15
  • Thanks, I added code like this instead: `formatter: function(val){ var days = val.getDate(), month = val.getMonth() + 1, year = val.getFullYear(), hour = val.getHours(), min = val.getMinutes(); return days + "-" + month + "-" + year + " " + hour + ":" + min; }` – Desmond Lai Jan 18 '17 at 07:44
  • @Desmond Lai can you [accept](http://stackoverflow.com/help/someone-answers) this answer? – wuxiandiejia Jan 18 '17 at 08:14