Home > php教程 > PHP开发 > body text

bootstrap-datetimepicker implements the method of displaying only the date

高洛峰
Release: 2016-12-05 11:33:09
Original
1658 people have browsed it

The example in this article describes the method of bootstrap-datetimepicker to display only the date. Share it with everyone for your reference. The details are as follows:

bootstrap-datetimepicker is usually set to hours, minutes and seconds. Sometimes it is not needed. How to deal with it?

minView: "month", //选择日期后,不会再跳转去选择时分秒
Copy after login

1. Introduction

<link href="Public/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="{sh::PUB}js/jquery-1.10.2.min.js"></script>
<link type="text/css" rel="stylesheet" href="{sh::PUB}css/bootstrap-datetimepicker.min.css">
<script src="{sh::PUB}js/bootstrap-datetimepicker.min.js" type="text/javascript" /></script>
<script src="{sh::PUB}js/bootstrap-datetimepicker.zh-CN.js" type="text/javascript" /></script>
Copy after login

2. Configuration

// 日历
$('.form_datetime').datetimepicker({
  minView: "month", //选择日期后,不会再跳转去选择时分秒
  language: 'zh-CN',
  format: 'yyyy-mm-dd',
  todayBtn: 1,
  autoclose: 1,
});
Copy after login

3.html

<div class="form-group row">
  <div class="left col-xs-3 text-right">
    <label for="">*时间:</label>
  </div>
  <div class="right col-xs-6 text-left">
    <div class="input-group">
     <input type="text" class="form-control form_datetime" id="addtime" name="addtime" value="{sh:$info.addtime|default=$time|date=&#39;Y-m-d&#39;,###}" placeholder="">
     <span class="input-group-addon" id="basic-addon2"><span class="glyphicon glyphicon-time" aria-hidden="true"></span></span>
    </div>
  </div>
</div>
Copy after login



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!