Bootstrap3 日期+时间选择控件

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

2.支持时间选择

3.支持时间段选择控制

4.支持中文

官网地址:http://eonasdan.github.io/bootstrap-datetimepicker/

moment语言包:https://github.com/moment/moment

moment时间格式化使用说明:http://momentjs.com/docs/

使用方法,引用的文件:

  1. <script src="Js/jquery-1.11.3.min.js"></script>
  2. <link href="Js/bootstrap-3.3.5-dist/css/bootstrap.css" rel="stylesheet" />
  3. <script src="Js/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
  4. <link href="Js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
  5. <script src="Js/bootstrap-datetimepicker/js/moment-with-locales.min.js"></script>
  6. <script src="Js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>

实例1:

<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')
});
});

Bootstrap3 datetimepicker控件的使用的更多相关文章

  1. 在asp.net mvc4项目里bootstrap datetimepicker控件的使用

    前段时间写了一篇关于调用阿里大于的短信接口来开发例会短信群发通知功能的文章http://www.cnblogs.com/zhouyuangan/p/apicall_1.html,其中的例会时间是需求中 ...

  2. DateTimePicker 控件的格式设置

    DateTimePicker 控件的格式设置 CustomFormat属性设置 : yyyy-MM-dd HH:mm:ss  月大写M,分钟小写m,小时H代表24小时计算,h代表12小时计算yyyy- ...

  3. winform中的dateTimePicker控件设置默认值为空

    winform中的dateTimePicker控件设置默认值为空   第一步:设置Format的属性值为“Custom” 第二步:设置CustomFormat的属性值为空,需要按一个空格键

  4. 【分享】自己写的一个可空的DateTimePicker控件-附源码

    最近这段时间在重构以前的一个项目,其中有一项就是要把DateTimePicker控件值可空.大家都知道的DateTimePicker值为DateTime类型,DateTime类型值不能等于Null.但 ...

  5. Delphi - DateTimePicker控件日期格式

    设置成显示年.月.日.时.分.秒 1:将DateTimePicker的Format属性中加入日期格式设成 'yyyy-MM-dd HH:mm:ss',注意日期里月份对应的MM是大写,时间里的分钟对应的 ...

  6. delphi中DateTimePicker控件同时输入日期和时间

    将DateTimePicker的Format属性中加入日期格式设成 'yyyy-MM-dd HH:mm',注意大小写 , 将kind设置为dtkTime即可,可以在每次Form onShow时将Dat ...

  7. C# DateTimePicker控件如何精确设置显示时分秒

    项目中需要使用DateTimePicker空间选定当前的时间,但是这个空间默认显示到天,如何能让它显示具体的小时和分钟呢? 我们看到有一个Format属性,Format令我们想到格式化,有这几种格式 ...

  8. DateTimePicker 控件置空

    dtOrderDateFrom.Format = DateTimePickerFormat.Custom; dtOrderDateFrom.CustomFormat = " "; ...

  9. C#DateTimePicker控件问题

    DateTimPicker控件在遇到29这样特殊的日期,选择时可能会出现 解决方案:在属性中把Value值设置为除29日外的其他日期或者在代码中直接设置Value值:DateTimePicker1 = ...

随机推荐

  1. Unable to find the ncurses libraries的解决办法

    我们在更新CentOS或者Ubuntu的内核时,执行make menuconfig可能看如这样的错误: *** Unable to find the ncurses libraries or the* ...

  2. 安装JBoss Tool 出错

    安装JBoss Tool 出错 具体报错如下:

  3. linux下ssd电子盘速度检测

    代码: #include<stdio.h> #include<sys/time.h> #include <fcntl.h> #include <pthread ...

  4. (二十四)mongodb中group的问题二

    今天的工作还是继续昨天没有完成的,由于对mongodb数据库的不熟悉,导致昨天的思路上也出了一点问题,我需要查询出同一个ruleID中不同的processingID的条数,然后根据条数来排列先后顺序, ...

  5. Django学习-22-Form

    Form是Django的功能较强的验证组件,负责各种表单验证 input中的name属性值要和form中的字段名相同 from django import forms from django.form ...

  6. CentOS配置samba服务

    1.服务器需要下载samba.sambaclient包 yum install samba samba-client -y 2.客户端需要下载samba-client.cifs-utils包 yum ...

  7. Linux中挂载Windows共享出来的目录

    Windows中1.新建文件夹,创建共享目录 右键文件夹,共享 2.设置访问方式 Everyone,添加确认 Linux-ubuntu中1.安装cifs#sudo apt-get install ci ...

  8. Spring Security验证流程剖析及自定义验证方法

    Spring Security的本质 Spring Security本质上是一连串的Filter, 然后又以一个独立的Filter的形式插入到Filter Chain里,其名为FilterChainP ...

  9. linux 安装沙盒virtualenv 、virtualenvwrapper

    1.沙盒安装命令: 最新版本:sudo easy_install virtualenv或者sudo apt-get install virtualenv 指定版本:pip install virtua ...

  10. Keras常见问题及解答

    Keras官方中文版文档 如何引用 Keras? 如何在 GPU 上运行 Keras? 如何在多 GPU 上运行 Keras 模型? "sample", "batch&q ...