Does bootstrap have a calendar control?
bootstrap has a calendar control, a time and date calendar control, named "datetimepicker". It is a Bootstrap component that can simplify the input of date and time on the page. The datetimepicker control supports date selection and format setting, and supports time period selection control. You only need to use script and link tags to introduce relevant files on the required page to use it.
#The operating environment of this article: Windows7 system, bootstrap3, Dell G3 computer.
Does bootstrap have a calendar control?
bootstrap has a time and date calendar control, named datetimepicker, which is a Bootstrap component that can simplify the input of date and time on the page.
Usage of Bootstrap datetimepicker control
1. Support date selection and format setting
2. Support time selection
3. Support time period selection control
4. Support Chinese
Involved styles and js:
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet"> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="static/js/moment-with-locales.js"></script> <script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
Let’s go directly to the example.
<div class="row"> <div class='col-sm-6'> <div class="form-group"> <label>选择日期:</label> <!--指定 date标记--> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> <div class='col-sm-6'> <div class="form-group"> <label>选择日期+时间:</label> <!--指定 date标记--> <div class='input-group date' id='datetimepicker2'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> </div> $(function () { $('#datetimepicker1').datetimepicker({ format: 'YYYY-MM-DD', locale: moment.locale('zh-cn') }); $('#datetimepicker2').datetimepicker({ format: 'YYYY-MM-DD hh:mm', locale: moment.locale('zh-cn') }); }); /*4.17版本一些可能用得到的方法参数*/ /* showClose:true//是否显示关闭 按钮 /*viewMode: 'days',//天数模块展示,months则为以月展示 daysOfWeekDisabled: false,//星期几 禁止选择,参数 [num],多个逗号隔开 calendarWeeks: false,//显示 周 是 今年第几周 toolbarPlacement:'default', //工具摆放的位置,top 则为上,默认为底 showTodayButton:false,//是否工具栏 显示 直达今天天数的 按钮,默认false showClear:false, //是否 工具栏显示 清空 输入框 的按钮。默认false */
Screenshot:
<div class="row"> <div class='col-sm-6'> <div class="form-group"> <label>选择开始时间:</label> <!--指定 date标记--> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> <div class='col-sm-6'> <div class="form-group"> <label>选择结束时间:</label> <!--指定 date标记--> <div class='input-group date' id='datetimepicker2'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> </div> $(function () { var picker1 = $('#datetimepicker1').datetimepicker({ format: 'YYYY-MM-DD', locale: moment.locale('zh-cn'), //minDate: '2016-7-1' }); var picker2 = $('#datetimepicker2').datetimepicker({ format: 'YYYY-MM-DD', locale: moment.locale('zh-cn') }); //动态设置最小值 picker1.on('dp.change', function (e) { picker2.data('DateTimePicker').minDate(e.date); }); //动态设置最大值 picker2.on('dp.change', function (e) { picker1.data('DateTimePicker').maxDate(e.date); }); });
$('#datetimepicker1').datetimepicker({ format: 'YYYY-MM-DD', locale: moment.locale('zh-cn'), defaultDate: "1990-1-1" });
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width" /> <title>datetimpicker测试</title> <!--图标样式--> <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <link href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css" rel="stylesheet"> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="https://cdn.bootcss.com/moment.js/2.24.0/moment-with-locales.js"></script> <script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> </head> <body> <div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <label>选择日期:</label> <!--指定 date标记--> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> <div class='col-sm-6'> <div class="form-group"> <label>选择日期+时间:</label> <!--指定 date标记--> <div class='input-group date' id='datetimepicker2'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> </div> </div> <script type="text/javascript"> $(function() { $('#datetimepicker1').datetimepicker({ format: 'YYYY-MM-DD', locale: moment.locale('zh-cn') }); $('#datetimepicker2').datetimepicker({ format: 'YYYY-MM-DD hh:mm', locale: moment.locale('zh-cn') }); }); </script> </body> </html>
bootstrap tutorial"
The above is the detailed content of Does bootstrap have a calendar control?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Regarding Llama3, new test results have been released - the large model evaluation community LMSYS released a large model ranking list. Llama3 ranked fifth, and tied for first place with GPT-4 in the English category. The picture is different from other benchmarks. This list is based on one-on-one battles between models, and the evaluators from all over the network make their own propositions and scores. In the end, Llama3 ranked fifth on the list, followed by three different versions of GPT-4 and Claude3 Super Cup Opus. In the English single list, Llama3 overtook Claude and tied with GPT-4. Regarding this result, Meta’s chief scientist LeCun was very happy and forwarded the tweet and

LayUI and Bootstrap can be integrated in the following ways: directly introduce styles and scripts, but you need to customize CSS override rules; use Sass to override Bootstrap variables, which requires Sass environment support; use Laystrap plug-ins to encapsulate the Bootstrap style version of LayUI components; use Layui Bootstrap plugin that automatically handles style overrides and responsive layout.

KafkaJava Best Practices and FAQ Timeout while creating producer: Check connection, network and producer properties configuration. Delay or error when consuming: optimize batch size and polling interval, check consumer processing logic efficiency. Guarantee message order: Create a single-partition topic, associate key and order, and use ordered sending method. Optimize throughput and latency: increase the number of partitions, adjust batch settings, and use high-speed storage. Manage Kafka cluster: monitor performance, clean up old messages, adjust the number of partitions, replicas and retention policies.

Layui and Bootstrap are two popular front-end frameworks. Layui is lightweight and modular, suitable for mobile-first development and projects with performance requirements. Bootstrap is widely used, responsive and suitable for developing large and complex applications. When choosing, consider criteria such as project size, mobile-firstness, customizability, supporting community, and more.

NIO technology and Reactor mode in Java functions NIO (non-blocking I/O) and Reactor mode are important technologies in Java concurrent programming. In Java functions, they are widely used through the Netty framework. NIO technology NIO is a non-blocking I/O model. Unlike traditional blocking I/O, NIO does not block the calling thread, but notifies the application through a callback mechanism when the I/O operation is ready. This enables applications to handle multiple I/O operations simultaneously, improving concurrency. In Java functions, NIO usually uses classes in the java.nio.channels package. Show

Converting from LayUI to Bootstrap involves the following steps: 1. Import the Bootstrap library; 2. Replace UI components; 3. Adjust styles; 4. Refactor JavaScript code; 5. Adapt the layout. When converting, consider using a JavaScript framework to simplify the process, and be careful to back up your code and make any necessary additional adjustments.

By integrating Bootstrap and Vue.js, you can simplify the process of building responsive, maintainable PHP web applications. Integrate Bootstrap: Install Bootstrap, load CSS and JS files in your index.php file, and use Bootstrap components in HTML. Integrate Vue.js: Install Vue.js, load the Vue.js file in the index.php file, create a Vue instance and mount it into your HTML. Practical case: Use Bootstrap and Vue.js to create a form containing input fields, buttons and Vue binding messages.

Can. Using Layui and Bootstrap together increases flexibility, provides a rich ecosystem, and optimizes performance. However, you need to pay attention to style conflicts, component overlap, and version compatibility. It is recommended to use Layui for core logic and Bootstrap for responsive layout.
