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.

enter image description here

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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -