Javascript Elessar-从条形图中获取固定和选定的值,并将值插入数据库
我正在使用Elessar库()创建块 我尝试选择蓝色的块,减去黄色的块,例如,我的代码应该向数据库插入值,值为3小时(bw 10am-12am=2小时,13:00-14:00=1小时总计=3小时)。 你能帮我查一下密码吗Javascript Elessar-从条形图中获取固定和选定的值,并将值插入数据库,javascript,php,mysql,elessar,Javascript,Php,Mysql,Elessar,我正在使用Elessar库()创建块 我尝试选择蓝色的块,减去黄色的块,例如,我的代码应该向数据库插入值,值为3小时(bw 10am-12am=2小时,13:00-14:00=1小时总计=3小时)。 你能帮我查一下密码吗 $(function () { $('body').prepend(RangeBar({ min: moment().startOf('day').format('LLLL'), max: moment().startOf('day').a
$(function () {
$('body').prepend(RangeBar({
min: moment().startOf('day').format('LLLL'),
max: moment().startOf('day').add(1, 'day').format('LLLL'),
valueFormat: function(ts) {
return moment(ts).format('HH:mm');
},
valueParse: function(date) {
return moment(date).valueOf();
},
values: [
[
moment().startOf('day').add(5.0, 'hours').format('LLLL'),
moment().startOf('day').add(6.0, 'hours').format('LLLL')
],
[
moment().startOf('day').add(12.0, 'hours').format('LLLL'),
moment().startOf('day').add(13.0, 'hours').format('LLLL')
],
[
moment().endOf('day').subtract(5.0, 'hours').format('LLLL'),
moment().endOf('day').subtract(4.0, 'hours').format('LLLL')
],
],
label: function(a){
var jsonText = JSON.stringify(a);
return jsonText;
},
snap: 1000 * 60 * 30,
minSize: 1000 * 60 * 60,
bgLabels: 24,
allowDelete: true,
indicator: null
}).on('changing', function(ev, ranges, changed) {
$('pre.changing').html(JSON.stringify(ranges,null,2));
}).$el);
$(document).ready(function() {
$('.elessar-range').addClass('fixed');
// it helps to set read only values - yellow blocks.
});
$("#submit").click(function () {
...
});
});
单击该按钮时,我希望将值插入db。
换句话说,我如何解析蓝色的值?
提前谢谢