直接修改bootstrap-datetimepicker.js中

update: function () {
var date, fromArgs = false;
if (arguments && arguments.length && (typeof arguments[0] === 'string' || arguments[0] instanceof Date)) {
date = arguments[0];
fromArgs = true;
} else {
//这里加了个判断,原来只有else部分,增加了对自定义格式的处理
if (this.element.val().length == 6) {
date = this.element.val().substring(0, 4) + "-" + this.element.val().substring(4, 6) + "-01";
} else {
date = (this.isInput ? this.element.val() : this.element.find('input').val()) || this.element.data('date') || this.initialDate;
if (typeof date == 'string' || date instanceof String) {
date = date.replace(/^\s+|\s+$/g, '');
}
}
} if (!date) {
date = new Date();
fromArgs = false;
} this.date = DPGlobal.parseDate(date, this.format, this.language, this.formatType); if (fromArgs) this.setValue(); if (this.date < this.startDate) {
this.viewDate = new Date(this.startDate);
} else if (this.date > this.endDate) {
this.viewDate = new Date(this.endDate);
} else {
this.viewDate = new Date(this.date);
}
this.fill();
}

bootstrap中datetimepicker只选择月份显示1899问题的更多相关文章

  1. bootstrap的datetimepicker只选择月份

    本文转载自:http://blog.csdn.net/feng1603/article/details/41869523 直接上代码: //选择年月日的 startView: 2, minView: ...

  2. Bootstrap中datetimepicker日期控件1899年问题解决

    Bootstrap中datetimepicker日期控件1899年问题解决 最近在开发项目的过程中,遇到一个很尴尬的问题.我们项目一直采用的是angular+bootstrap,日期控件用的是boot ...

  3. easyui datebox 只选择月份的方法

    easyui datebox 只选择月份的方法 效果如下图: 代码如下: <html > <head> <meta charset="utf-8"&g ...

  4. easyUI日期框返回到月份,选择日期也只到月份

    easyUI日期框返回到月份,选择日期也只到月份,不是原创,引用了园友的一篇文章,自己写下来,以便不时之需,谢谢. 1 $(function () { $('#date').datebox({ onS ...

  5. bootstrap 默认显示1899问题

    今天使用bootstrap的 dateTimePicker控件时候,又碰到了去年的 显示 1899年的问题,之前解决过,但是忘记了.就记得 他的代码里面有一段是 说格式不正确或者 时间格式小于某个值时 ...

  6. Devexpress GridControl中 repositoryItemCheckEdit作为选择列以及作为显示列的使用方法

    一.在gridcontrol列表控件中使用单选框作为选择列,这里有两种方式. 方式一:选择gridcontrol控件的Run Designer按钮,添加一列,设置该列的ColumnEdit为check ...

  7. Bootstrap中DropDown插件显示下拉列表,点击下拉列表区域,不会再自动关闭。

    目标: Bootstrap中DropDown插件显示下拉列表,点击下拉列表区域,不会再自动关闭. 参考:http://v3.bootcss.com/javascript/#dropdowns    / ...

  8. 物联网平台设计心得:DateTimePicker实现选择联动

    所谓的选择联动,就是指,当我DateTimePicker1选择2月4号的时候,我DateTimePicker2只能选择2月4号和2月5号两天,当然你可以自行规定要选择的日期.这在一些图表查询条件里面是 ...

  9. 基于bootstrap的datetimepicker插件

    1.当时使用的资源地址:http://www.bootcss.com/p/bootstrap-datetimepicker/ 2.如何让时间只显示到日期,不显示具体时刻 控制显示精度的是datetim ...

随机推荐

  1. 310. Minimum Height Trees

    For a undirected graph with tree characteristics, we can choose any node as the root. The result gra ...

  2. OC小结

    #import <Foundation/Foundation.h>#import "Person.h"int main(int argc, const char * a ...

  3. Ultra Pull To Refresh下拉刷新

    http://www.jcodecraeer.com/a/opensource/2014/1205/2111.html

  4. 转 用 AXIOM 促进 XML 处理

    转自:http://www.ibm.com/developerworks/cn/xml/x-axiom/ AXIOM 还不是另一种对象模型.它有着明确的设计目标:大幅提升 Apache 下一代 SOA ...

  5. 某种数列问题 (jx.cpp/c/pas) 1000MS 256MB

    众所周知,chenzeyu97有无数的妹子(阿掉!>_<),而且他还有很多恶趣味的问题,继上次纠结于一排妹子的排法以后,今天他有非(chi)常(bao)认(cheng)真(zhe)去研究一 ...

  6. 放课后的约定 by:S_H_Y

    题目背景 十年.十年前.天空的蔚蓝,云彩的舒软.我,怎么会认识你.洁白的,洁白的,十年前.我无法忘却.终究是小时候的约定.记忆被困在冻土里,有时我不认识那天的我.难道一切,都锁在心里面了吗? 题目描述 ...

  7. POJ2375 Cow Ski Area (强连通)(缩点)

                                        Cow Ski Area Time Limit: 1000MS   Memory Limit: 65536K Total Sub ...

  8. PHP的一些要点

    1.用户评论的内容应当使用htmlspecialchars()函数进行过滤,如htmlspecialchars($_POST['content']);再写入数据库,防止用户评论中含有JS和HTML代码 ...

  9. Java——集合框架 工具

     /* * Arrays工具类的使用 */ public class ArraysTest { public static void main(String[] args) { // TODO A ...

  10. ps颜色相加

    一. 红+绿=黄 红+蓝=品红 绿+蓝=青 白色:红+绿+蓝=白色.(黄.品红.青,两种以上颜色相加是白色) 互补色:红->青.绿->品红.蓝->黄 二. 品红+黄=红 青+黄=绿 ...