$.extend($.fn.datagrid.defaults.editors, {
datetimebox: {// datetimebox就是你要自定义editor的名称
init: function (container, options) {
var input = $('<input class="easyuidatetimebox">').appendTo(container);
return input.datetimebox({
formatter: function (date) {
return new Date(date).format("yyyy-MM-dd hh:mm:ss");
}
});
},
getValue: function (target) {
return $(target).parent().find('input.combo-value').val();
},
setValue: function (target, value) {
$(target).datetimebox("setValue", value);
},
resize: function (target, width) {
var input = $(target);
if ($.boxModel == true) {
input.width(width - (input.outerWidth() - input.width()));
} else {
input.width(width);
}
}
}
});
// 时间格式化
Date.prototype.format = function (format) {
/*
* eg:format="yyyy-MM-dd hh:mm:ss";
*/
if (!format) {
format = "yyyy-MM-dd hh:mm:ss";
} var o = {
"M+": this.getMonth() + 1, // month
"d+": this.getDate(), // day
"h+": this.getHours(), // hour
"m+": this.getMinutes(), // minute
"s+": this.getSeconds(), // second
"q+": Math.floor((this.getMonth() + 3) / 3), // quarter
"S": this.getMilliseconds()
// millisecond
}; if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
} for (var k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
}
}
return format;
};

datetimebox的更多相关文章

  1. 时间控件之赋值问题:datetimebox

    1.datetimebox不显示毫秒数: <input class="easyui-datetimebox" name="birthday" data-o ...

  2. easyUI中datetimebox和combobox的取值方法

    easyUi页面布局中,查询条件放在JS中,如下 <script type="text/javascript"> var columnList = [ [   {    ...

  3. EasyUI修改DateBox和DateTimeBox的默认日期格式

      最近整理Easyui控件的时候,对Easyui的DateBox控件和DateTimeBox控件进行了梳理,而我之所以将EasyUI的DateBox控件和DateTimeBox控件放在一起,归为一类 ...

  4. EasyUI改动DateBox和DateTimeBox的默认日期格式

    近期整理Easyui控件的时候,对Easyui的DateBox控件和DateTimeBox控件进行了梳理,而我之所以将EasyUI的DateBox控件和DateTimeBox控件放在一起,归为一类,是 ...

  5. easyui DateTimeBox 取值

    $('#dt').datetimebox('getValue')

  6. DateTimeBox( 日期时间输入框)

    本节课重点了解 EasyUI 中 DateTimeBox(日期时间输入框)组件的使用方法,这个组件依赖于 DateBox(日期输入框)组件和 TimeSpinner(时间微调)组件. 一. 加载方式/ ...

  7. easyui DateTimeBox OK

    一.datetimebox   ok按钮没有点击事件,但是可以通过onSelect事件模拟出“点击了ok按钮一样的效果”,我的代码: 关键: 0,理解DateTimeBox控件,这个控件是由DateB ...

  8. 自定义EasyUI的datetimebox控件日期时间的显示格式(转)

    工作中遇到的问题,在此记录一下. 需求:前台页面使用了EasyUI框架,在某一个html页面中要求datetimebox显示格式为年月日和小时,如图所示: 尝试过两种方法,分别如下: 第一种方法: d ...

  9. Easyui的datagrid的editor(行编辑器)如何扩展datetimebox类型

    在easyui的datagrid扩展方法中添加这样的时间日期(datetimebox)代码块 放在   $.extend($.fn.datagrid.defaults.editors,{datetim ...

  10. datagrid行内编辑时为datetimebox

    $.extend($.fn.datagrid.defaults.editors, { datetimebox: {// datetimebox就是你要自定义editor的名称 init: functi ...

随机推荐

  1. Java_Chapter6_类与对象

    6.1 类与对象的概念 6.2 定义类 class Cylinder { double radius; int height; double pi; void setCylinder(double r ...

  2. 20165101刘天野 2018-2019-2《网络对抗技术》Exp3 免杀原理与实践

    20165101刘天野 2018-2019-2<网络对抗技术>Exp3 免杀原理与实践 1. 实践内容 1.1 正确使用msf编码器,msfvenom生成如jar之类的其他文件,veil- ...

  3. PHP的date函数的时区问题

    来自:http://www.cnblogs.com/fuland/p/4250462.html(“腐烂的翅膀”的博客) 从php5.1.0开始,php.ini里加入了date.timezone这个选项 ...

  4. centos、linux查找未挂载磁盘格式化并挂载?

    centos.linux查找未挂载磁盘格式化并挂载? df -h 查看当前linux服务器硬盘: fdisk -l /dev/sda   第一块硬盘 /dev/sdb   第二块硬盘 依此类推 以/d ...

  5. eclipse——添加Tomcat7.0服务器

    首先要安装好Tomcat 然后在eclipse中添加Tomcat 步骤如下 详细可参考这篇博客https://blog.csdn.net/u014079773/article/details/5139 ...

  6. PHP 开发环境搭建

    1. PHP (1) download PHP and extra the zip file to the folder “C:\tools\php” (2) add the path “;C:\to ...

  7. LeetCode第[1]题(Java):Two Sum (俩数和为目标数的下标)——EASY

    题目: Given an array of integers, return indices of the two numbers such that they add up to a specifi ...

  8. activity启动模式之singleTop

    activity启动模式之singleTop 一.简介 二.设置方法 在AndroidManifest.xml中将要设置为singleTop启动模式的页面进行配置 <activity andro ...

  9. oracle: 分割字符串,或者查找字段里面的关键字(关键字1,关键字2,关键字3)

    表中有一个字段:keyword, keyword里面的存储的字符一般是:[关键字1,关键字2,关键字3] 那么,在搜索的时候,不能用like 来模糊查询,因为这样会,多查询出一下不相干的关键字, hi ...

  10. SPOJ - VLATTICE

    链接 题意:三维平面,找从(0,0,0)看(n,n,n)能看到的点 题解:很明显就是求gcd(i,j,k)==1的(i,j,k)对数,改一下公式即可,记得要算平行坐标轴的三个平面,还有含0的三个坐标 ...