bootstrap:時間日付カレンダーコントロール(datetimepicker)

11137 ワード

https://blog.csdn.net/qq_33368846/articale/detail/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> <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> <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>
 
転載先:https://www.cnblogs.com/gcgc/p/11154611.html