简体   繁体   中英

Setting up Date Time picker

I created this Date time range picker using a code generator on http://www.daterangepicker.com/ . Right now I just get the field and gif to display with no calendar. I put an alert on the js page and was able to access the page.

<div id="conflict" class="pull-right" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%">
   <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>&nbsp;
   <span></span> <b class="caret"></b>
</div>

This is the Javascript:

$('#conflict').daterangepicker({
"timePicker": true,
"parentEl": "conflict",
"startDate": "04/25/2017",
"endDate": "05/01/2017"
}, function(start, end, label) {
   console.log("New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')");
});

It really helps when setup everything that you need to. I didn't have moment.js setup. Once that was setup everything worked perfectly

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM