bootstrap的datetimepicker只选择月份
本文转载自:http://blog.csdn.net/feng1603/article/details/41869523
直接上代码:
//选择年月日的 startView: 2, minView: 2, format: 'yyyymmdd',
$('#datetimepicker').datetimepicker({
format: 'yyyymmdd',
weekStart: 1,
autoclose: true,
startView: 2,
minView: 2,
forceParse: false,
language: 'zh-CN'
});
//选择年月的 startView: 3, minView: 3, format: 'yyyymm',
$('#datetimepicker').datetimepicker({
format: 'yyyymm',
weekStart: 1,
autoclose: true,
startView: 3,
minView: 3,
forceParse: false,
language: 'zh-CN'
});
//选择年的 startView: 4, minView: 4, format: 'yyyy',
$('#datetimepicker').datetimepicker({
format: 'yyyymm',
weekStart: 1,
autoclose: true,
startView: 4,
minView: 4,
forceParse: false,
language: 'zh-CN'
});
<div class="col-md-7">
<div class='input-group date form_date' >
<input name="startTm" id="datetimepicker" type='text' class="form-control input-sm" readonly="readonly"/>
<span class="input-group-addon input-sm">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
在这里遇到很多问题:什么日历图标没反映啊,输入框和日历图标对不齐啊,点日历图标把数据清了啊……都是样式问题,所以提供几种样式,一种一种试吧……博大精深啊……
<div class='input-group date form_date' data-date-format="yyyymmdd">
<input name="startTm" id="startTm" type='text' class="form-control input-sm" readonly="readonly"/>
<span class="input-group-addon input-sm">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
<div class="date input-append" id="datetimepicker">
<div class="input-group">
<input class="form-control input-sm" readonly="readonly" type="text">
<span class="add-on input-group-addon"><i class="icon-remove"></i></span>
<span class="add-on input-group-addon"><i class="icon-th"></i></span></div>
</div>
bootstrap的datetimepicker只选择月份的更多相关文章
- bootstrap中datetimepicker只选择月份显示1899问题
直接修改bootstrap-datetimepicker.js中 update: function () { var date, fromArgs = false; if (arguments &am ...
- easyui datebox 只选择月份的方法
easyui datebox 只选择月份的方法 效果如下图: 代码如下: <html > <head> <meta charset="utf-8"&g ...
- bootstrap datetimepicker 中只显示年或者只显示月份
1.只显示datetimepicker 日历中只显示年份 $("#day-access-calendar").datepicker({ startView: 2, maxView ...
- easyUI日期框返回到月份,选择日期也只到月份
easyUI日期框返回到月份,选择日期也只到月份,不是原创,引用了园友的一篇文章,自己写下来,以便不时之需,谢谢. 1 $(function () { $('#date').datebox({ onS ...
- 基于bootstrap的datetimepicker插件
1.当时使用的资源地址:http://www.bootcss.com/p/bootstrap-datetimepicker/ 2.如何让时间只显示到日期,不显示具体时刻 控制显示精度的是datetim ...
- bootstrap的datepicker在选择日期后调用某个方法
bootstrap的datepicker在选择日期后调用某个方法 2016-11-08 15:14 1311人阅读 评论(0) 收藏 举报 首先感谢网易LOFTER博主Ivy的博客,我才顿悟了问题所在 ...
- 关于antd 日期组件只选择年份,设置mode=year无法获取value的解决办法
antd3.0后的某个版本后终于支持了只选择年份的设置.当时2.x版本的时候还不支持只选择年份,我们项目中有这个只选择年份的需求,为了ui风格的一致,只好自己撸了一个. 如今真是普天同庆!
- Bootstrap中datetimepicker日期控件1899年问题解决
Bootstrap中datetimepicker日期控件1899年问题解决 最近在开发项目的过程中,遇到一个很尴尬的问题.我们项目一直采用的是angular+bootstrap,日期控件用的是boot ...
- JavaScript-自制日历控件(只选择年月)
<style> *{margin: 0px; padding: 0px;} </style> <input type="text" name=&quo ...
随机推荐
- python 怎样使用安装库
win: 1.使用匹配安装 进入pip所在目录C:\Python27\Scripts pip intasll lxml 2.源码下载安装 下载源码,解压到任意目录 cd 进入到setup.py的目录 ...
- NetSetMan IP地址切换工具
http://www.netsetman.com/en/freeware NetSetMan NetSetMan是一个网络设置管理器,它可以很容易在6种不同的,视觉结构化的配置之间切换,包括: IP地 ...
- 在centos使用rpm包的方式安装mysql,以及更改root密码
在centos使用rpm包的方式安装mysql,对于centos官方实际推荐使用yum进行安装,下载安装的方式主要用于内网服务器不能连接外网yum源的情况. 下载包 首先根据centos版本在mysq ...
- 用java将excel表格中的内容修改后写入到另一个excel中
package nn; import java.io.File; import jxl.Cell; import jxl.Sheet; import jxl.Workbook; import jxl. ...
- xmind的第四天笔记
- Integer to Roman
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 t ...
- UVa 442 矩阵链乘(栈)
Input Specification Input consists of two parts: a list of matrices and a list of expressions. The f ...
- console下纯字符实现的贪吃蛇
最近简直超级无聊-- code blocks win7 64编译运行无问题,应该其他编译器也不会有问题. w:上 s:下 a:左 d:右 CS标准方向控制,AK47和M4这种高级货是没有滴-- 废话不 ...
- Linux驱动设计——内存与IO访问
名词解释 内存空间与IO空间 内存空间是计算机系统里面非系统内存区域的地址空间,现在的通用X86体系提供32位地址,寻址4G字节的内存空间,但一般的计算机只安装256M字节或者更少的内存,剩下的高位内 ...
- CentOS6.4安装Golang环境
什么是Go? Go是一门并发支持.垃圾回收的编译型的系统编程语言,目的是为了创造一门具有在静态编译语言的高性能和动态语言的高效开发之间拥有良好平衡点的一门编程语言. Go的主要特点有哪些? 类型安全和 ...