Javascript noUiSlider工具提示中的日期格式
我试图在我的项目中使用noUiSlider,但我无法在工具提示中应用日期格式。我刚在室外电视台拍到 看看这个 您可以使用格式选项: 已更新。您可以使用格式选项: 更新Javascript noUiSlider工具提示中的日期格式,javascript,nouislider,Javascript,Nouislider,我试图在我的项目中使用noUiSlider,但我无法在工具提示中应用日期格式。我刚在室外电视台拍到 看看这个 您可以使用格式选项: 已更新。您可以使用格式选项: 更新 noUiSlider.create(dateSlider, { behaviour: 'tap', connect: true, tooltips: [ true, true ], range: { min: timestamp('2016-06-01') + 24 * 60 * 6
noUiSlider.create(dateSlider, {
behaviour: 'tap',
connect: true,
tooltips: [ true, true ],
range: {
min: timestamp('2016-06-01') + 24 * 60 * 60 * 1000,
max: timestamp(date)
},
step: 1 * 24 * 60 * 60 * 1000,
start: [timestamp(previousMonth), timestamp(date)]
});
// Move formatting code into a function
function toFormat ( v ) {
return formatDate(new Date(v));
}
// Add a formatter to the slider
format: { to: toFormat, from: Number }
// You can then directly use the value in the update function
dateValues[handle].innerHTML = values[handle];