如何开始和结束日期和时间范围选择器?

时间:2022-06-17 07:58:30

I can't see how to get the start and end from a date and time range picker I usually use data-link-field="dtp_input1" to get the data to insert into a table like I code it like this:

我无法看到如何从日期和时间范围选择器获取开始和结束我通常使用data-link-field =“dtp_input1”来将数据插入到表中,就像我这样编码:

<input type="hidden" id="dtp_input1" name="date" value="" /><br/>

Now my code from date and time range picker is like this:

现在我的日期和时间范围选择器的代码是这样的:

<div class="form-group">
    <label>Date and time range:</label>
    <div class="input-group">
        <div class="input-group-addon"> <i class="fa fa-clock-o"></i>

        </div>
        <input type="text" class="form-control pull-right" id="reservationtime">
    </div>
    <!-- /.input group -->
</div>
<!-- /.form group -->

and for the javascript:

并为javascript:

 $('#reservationtime').daterangepicker({
     timePicker: true,
     timePickerIncrement: 30,

     format: 'MM/DD/YYYY h:mm A'
 });

please see my screenschot

请看我的screenchot

how can i code to get start and end and enter it on mysql database

我怎么能编码来开始和结束并在mysql数据库中输入它

1 个解决方案

#1


0  

$('#reservationtime').daterangepicker({
    timePicker: true, timePickerIncrement: 30, 
    format: 'MM/DD/YYYY h:mm A'
}).bind('datepicker-change',function(event, obj)    
    /* This event will be triggered when second date is selected */
    console.log('change',obj);
    // obj will be something like this:
    // {
    //      date1: (Date object of the earlier date),
    //      date2: (Date object of the later date),
    //      value: "2013-06-05 to 2013-06-07"
    // }
})

#1


0  

$('#reservationtime').daterangepicker({
    timePicker: true, timePickerIncrement: 30, 
    format: 'MM/DD/YYYY h:mm A'
}).bind('datepicker-change',function(event, obj)    
    /* This event will be triggered when second date is selected */
    console.log('change',obj);
    // obj will be something like this:
    // {
    //      date1: (Date object of the earlier date),
    //      date2: (Date object of the later date),
    //      value: "2013-06-05 to 2013-06-07"
    // }
})