码迷,mamicode.com
首页 > 其他好文 > 详细

bootstrap:时间日期日历控件(datetimepicker)

时间:2019-07-09 00:14:07      阅读:317      评论:0      收藏:0      [点我收藏+]

标签:calendar   tar   imp   rip   span   head   cdn   bootstrap   使用   

https://blog.csdn.net/qq_33368846/article/details/82223676

 

Bootstrap datetimepicker控件的使用

1.支持日期选择,格式设定

2.支持时间选择

3.支持时间段选择控制

4.支持中文

 

涉及的样式及js:

<!DOCTYPE html>
<html>
<head>
    <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="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> <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> </html>

 

bootstrap:时间日期日历控件(datetimepicker)

标签:calendar   tar   imp   rip   span   head   cdn   bootstrap   使用   

原文地址:https://www.cnblogs.com/gcgc/p/11154611.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!