javascript - Elessar - get the values from bar which are fixed and selected and insert values to the db -
i'm using elessar library ( https://github.com/quarterto/elessar ) create blocks.
i'm trying select blocks blue , subtract yellow ones, example code should insert value database 3 hour (bw 10am-12am= 2 hour , 13:00-14:00= 1 hour total= 3 hours). please me code?
$(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'); // helps set read values - yellow blocks. }); $("#submit").click(function () { ... }); });
when click button, want insert values db. in other words, how can parse values blue? in advance.
Comments
Post a Comment