之前做的一个商城项目,后台系统页面使用Easyui做的,记录一个当时卡住的地方:

首先通过<table>标记创建数据网格(datagrid)

<table class="easyui-datagrid" id="contentList" data-options="toolbar:contentListToolbar,singleSelect:false,collapsible:true,pagination:true,method:'get',pageSize:20,url:'*******',queryParams:{categoryId:0}">
    <thead>
    <tr>
   <th data-options="field:'id',width:30">ID</th>
   <th data-options="field:'title',width:120">内容标题</th>
   <th data-options="field:'subTitle',width:100">内容子标题</th>
   <th data-options="field:'pic',width:50,align:'center'">图片</th>
   <th data-options="field:'created',width:130,align:'center'">创建日期</th>
   <th data-options="field:'updated',width:130,align:'center'">更新日期</th>
</tr>
</thead>
</table>

接着在js写一个方法并引用

formatDateTime : function(val,row){

var now = new Date(val);
 return now.format("yyyy-MM-dd hh:mm:ss");

}

最后在需要更改那一栏添加改方法

<th data-options="field:'created',width:130,align:'center',formatter:E3.formatDateTime">创建日期</th>

<th data-options="field:'updated',width:130,align:'center',formatter:E3.formatDateTime">更新日期</th>

效果如下:

End——————————————————————

使用easyui框架 设置时间格式的更多相关文章

  1. Java json设置时间格式,Jackson设置时间格式,json设置单引号

    Java json设置时间格式,Jackson设置时间格式,json设置单引号 >>>>>>>>>>>>>>> ...

  2. win7 下设置时间格式为yyyy-MM-dd 格式无效的解决方法

    部分win7 64位机器,在时间区域部分设置了时间格式为:yyyy-MM-dd后程序和数据库里面还是原来默认的yyyy/MM/dd格式 打开注册表,搜索 yyyy/MM/dd ,修改为yyyy-MM- ...

  3. Matplotlib绘图双纵坐标轴设置及控制设置时间格式

    双y轴坐标轴图 今天利用matplotlib绘图,想要完成一个双坐标格式的图. fig=plt.figure(figsize=(20,15)) ax1=fig.add_subplot(111) ax1 ...

  4. Delphi 设置时间格式

    // 设置WINDOWS系统的短日期的格式SetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SSHORTDATE, 'yyyy-MM-dd'); Applicat ...

  5. Java-SSM框架页面时间格式转换

    在JSP中,列表查询绑定时间时,会出现以下的时间格式,那样看起来的话,感觉... 那如何转换成“yyyy-MM-dd HH:mm:ss”格式呢?--很简单,在JSP头顶加上 <%@ taglib ...

  6. easyui时的时间格式yyyy-MM-dd与yyyy-MM-ddd HH:mm:ss

    easyui日期的转换,日期汉化导入:<script type="text/javascript" src="../easyui/locale/easyui-lan ...

  7. SQL设置时间格式

    SELECT STR_TO_DATE('Jul 20 2013 7:49:14:610AM','%b %d %Y %h:%i:%s:%f%p') from DUAL; -- 执行后得到结果:'2013 ...

  8. jQuery设置时间格式

    <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8&quo ...

  9. WordPress 博客文章时间格式the_time()设置

    国外设计的WordPress 主题里的文章的时间格式是类似“十一月 21, 2010”这种格式的,而中国人习惯的是年在前,月紧跟其后,日在末尾,所以看国外的就显得很别扭,但是我们可以通过修改WP时间代 ...

随机推荐

  1. 树——minimum-depth-of-binary-tree(二叉树的最小深度)

    问题: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the s ...

  2. Sass:@error

    @error 和 @warn.@debug 功能是如出一辙. @mixin error($x){ @if $x < 10 { width: $x * 10px; } @else if $x == ...

  3. 封装 pyinstaller -F -i b.ico excel.py

    安装pywin32,可以参考<怎么给python安装pywin32模块?> 一定要注意对应的python版本,否则不能安装.   5怎么给python安装pywin32模块?   2 用命 ...

  4. How to permanently set $PATH on Linux/Unix?

    You need to add it to your ~/.profile or ~/.bashrc file. export PATH=$PATH:/path/to/dir Depending on ...

  5. django数据库迁移相关【sqlite3迁移到MySQL】(django2.0.3测试通过)

    前言 项目部署到服务器之后,用的数据库还是sqlite3. 发现一些问题,sqlite3是小巧,但是服务器上查看数据库比较费劲,不能直观看到数据.可是我们经常需要即时.直观查看数据,这就用到MySQL ...

  6. python 全栈开发,Day53(jQuery的介绍,jQuery的选择器,jQuery动画效果)

    01-jQuery的介绍 1.为什么要使用jQuery 在用js写代码时,会遇到一些问题: window.onload 事件有事件覆盖的问题,因此只能写一个事件. 代码容错性差. 浏览器兼容性问题. ...

  7. Prime算法 与 Kruskal算法求最小生成树模板

    算法原理参考链接 ==> UESTC算法讲堂——最小生成树 关于两种算法的复杂度分析 ==> http://blog.csdn.net/haskei/article/details/531 ...

  8. 调试 & 常数优化:我有特别的 debug 技巧

    rxz 的调试技巧(https://www.zhihu.com/question/60719584/answer/179363450): #define DEBUG printf("Pass ...

  9. [CSP-S模拟测试]:不等式(数学)

    题目描述 小$z$热衷于数学.今天数学课的内容是解不等式:$L\leqslant S\times x\leqslant R$.小$z$心想这也太简单了,不禁陷入了深深的思考:假如已知$L,R,S,M$ ...

  10. Python分布式爬虫打造搜索引擎完整版-基于Scrapy、Redis、elasticsearch和django打造一个完整的搜索引擎网站

    Python分布式爬虫打造搜索引擎 基于Scrapy.Redis.elasticsearch和django打造一个完整的搜索引擎网站 https://github.com/mtianyan/Artic ...