Question

I would like to use the Elessar library, and configure it to select multiple hour ranges (of a single day). like so:

enter image description here

This kind of looks right, but obviously the "a few seconds" ranges are incorrect. Here is my current configuration:

min: moment([2007, 0, 29]),
max: moment([2007, 0, 30]),
valueFormat: function(ts) {
  return moment(ts).format('LT');
},
valueParse: function(date) {
  return moment(date).valueOf();
},
label: function(a){
  return moment(a[1]).from(a[0], true);
},
snap: 1000 * 60 * 15,
minSize: 1000 * 60 * 60,
barClass: 'progress',
rangeClass: 'bar',
maxRanges: 3,
bgLabels: 12

Any ideas how to fix the range labels?

Was it helpful?

Solution

I think the answer is a little late but....

label: function(a) { 
    var from =  moment(a[0]);
    var until =  moment(a[1]);
    return from.format('HH:mm') + ' to ' + until.format('HH:mm');
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top