Home >Web Front-end >Bootstrap Tutorial >How to use bootstrap to select the time of year, month and day
The following describes how to use bootstrap to select the time of year, month and day.
Use bootstrap to implement time selection. The page needs to load the following files: (recommended learning: Bootstrap video tutorial)
1, CSS file: bootstrap.min.css, bootstrap-datetimepicker.min.css
2, JS file: jquery-1.8 .3.min.js, bootstrap.min.js, bootstrap-datetimepicker.js, bootstrap-datetimepicker.zh-CN.js
Use bootstrap to implement year selection.
The bootstrap configuration code is as follows:
<script> $('.form_datetime').datetimepicker({ language: 'zh-CN', minView: 4, format: 'yyyy', startDate:2019, autoclose: 1, startView: 4, }); </script>
Use bootstrap to select the month.
The bootstrap configuration code is as follows:
<script> $('.form_datetime').datetimepicker({ format: 'mm', autoclose:true, startView:3, minView:3, maxView:3, initialDate:new Date(), language:'zh-CN' }); </script>
Use bootstrap to select the year, month and day.
bootstrap configuration code is as follows:
<script> $('.form_datetime').datetimepicker({ format: 'yyyymmdd', weekStart: 1, autoclose: true, startView: 2, minView: 2, language:'zh-CN' }); </script>
The effect achieved is as follows:
##More Bootstrap For related technical articles, please visit theBootstrap Tutorial column to learn!
The above is the detailed content of How to use bootstrap to select the time of year, month and day. For more information, please follow other related articles on the PHP Chinese website!