Kendo Web UI Grid里时间格式转换
我和大家分享一下我的kendo的学习心得。如果不好的地方多多包含或者给我留言请看图

kendo里时间格式如图Oder Date列里的格式。但是我们想把时间转换成中国人习惯的格式。如Shipped Date列里的格式。
这个就要在设置列里加一个格式format: "{0:yyyy/MM/dd}"请记住开头的 格式都要加一个0:你要排在前面的日期字母。如月/日格式:format:"{0:MM/dd}",单独月:format:"{0:MM}"整个Grid显示效果代码:
<div id="grid"></div>
<script>
$(document).ready(function() {
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: "http://demos.telerik.com/kendo-ui/service/Northwind.svc/Orders"
},
schema: {
model: {
fields: {
OrderID: { type: "number" },
ShipCountry: { type: "string" },
ShipCity: { type: "string" },
ShipName: { type: "string" },
OrderDate: { type: "date" },
ShippedDate: {type: "date" }
}
}
},
pageSize: 15
},
height: 430,
sortable: true,
reorderable: true,
resizable: true,
pageable: true,
columns: [
{
field: "OrderDate",
title: "Order Date",
width: 110,
format: "{0:MM/dd/yyyy}"
},
{
field: "ShipCountry",
title: "Ship Country",
width: 110
},
{
field: "ShipCity",
title: "Ship City",
width: 110
},
{
field: "ShipName",
title: "Ship Name",
width: 200
},
{
field: "ShippedDate",
title: "Shipped Date",
format: "{0:yyyy/MM/dd}"
},
{
field: "OrderID",
title: "ID",
width: 60
}
]
});
});
</script>
</div>
详细访问http://demos.telerik.com/kendo-ui/web/grid/column-reordering.html


Kendo Web UI Grid里时间格式转换的更多相关文章
- Kendo Web UI Grid添加一个html控件如(checkbox,button)
在Kendo Web UI Grid增加一个控件如效果图: <div id="grid1"></div><script> $("#gr ...
- Kendo Web UI Grid数据绑定,删除,编辑,并把默认英文改成中文
Kendo Web UI 是个不错的Jquery框.可惜老外写的,很多都是默认的英文,当然我们也可以设置成中文,接下来,我们就看看Grid是如何实现的数据绑定(Kendo Grid数据绑定实现有很多方 ...
- SQL Server日期时间格式转换字符串详解 (详询请加qq:2085920154)
在SQL Server数据库中,SQL Server日期时间格式转换字符串可以改变SQL Server日期和时间的格式,是每个SQL数据库用户都应该掌握的.本文我们主要就介绍一下SQL Server日 ...
- SQL Server日期时间格式转换字符串
在SQL Server数据库中,SQL Server日期时间格式转换字符串可以改变SQL Server日期和时间的格式,是每个SQL数据库用户都应该掌握的.本文我们主要就介绍一下SQL Server日 ...
- MySQL时间戳和时间格式转换函数
MySQL时间戳和时间格式转换函数:unix_timestamp and from_unixtime unix_timestamp将时间转化成时间戳格式.from_unixtime将时间戳转化成时间格 ...
- Sql日期时间格式转换;取年 月 日,函数:DateName()、DATEPART()
一.sql server2000中使用convert来取得datetime数据类型样式(全) 日期数据格式的处理,两个示例: CONVERT(varchar(16), 时间一, 20) 结果:2007 ...
- SQL Server日期时间格式转换字符串详解
本文我们主要介绍了SQL Server日期时间格式转换字符串的相关知识,并给出了大量实例对其各个参数进行对比说明,希望能够对您有所帮助. 在SQL Server数据库中,SQL Server日期时间格 ...
- sql 日期时间格式转换
Sql日期时间格式转换 sql server2000中使用convert来取得datetime数据类型样式(全) 日期数据格式的处理,两个示例: CONVERT(varchar(16), 时间一, ...
- [php基础]Mysql日期函数:日期时间格式转换函数详解
在PHP网站开发中,Mysql数据库设计中日期时间字段必不可少,由于Mysql日期函数输出的日期格式与PHP日期函数之间的日期格式兼容性不够,这就需要根据网站实际情况使用Mysql或PHP日期转换函数 ...
随机推荐
- mysql分表方法实现
一般来说,当我们的数据库的数据超过了100w记录的时候就应该考虑分表或者分区了,这次我来详细说说分表的一些方法.目前我所知道的方法都是MYISAM的,INNODB如何做分表并且保留事务和外键,我还不是 ...
- 一个关于poi导出的API
先准备需要的参数 参数1:String title=“用户信息” 参数2:String[] headers String[] headers = { "用户名", "昵称 ...
- jboss-AS目录结构了解(资料摘取)
Directory Description bin Contains startup, shutdown and other system-specific scripts. Basically al ...
- Servlet 中的out.print()与out.writer()的区别
PrintWriter out = response.getWriter(); out.print(obj)其源码如下: public void print(Object obj) { write(S ...
- github三大步骤
1)git init : 初始化当前目录,把这个目录变成Git可以管理的目录 2)git add [文件名称]: 把文件添加到仓库 3)git commit -m "对当前提交文件的描述& ...
- python中的嵌套类(内部类调用外部类中的方法函数)
在为书中版本是3.X的,但2.X不太支持直接调用. 所以,在PYTHON2.X中,要在内部类中调用外部类的方法,就必须得实例化外部类,然后,传入实例进行调用. 花了我两个小时啊,资料没找到,自己一个一 ...
- Codeforces 526E Transmitting Levels
http://codeforces.com/contest/526/problem/E 题意:给一个环,每个点有权值,每次给一个数B,求把这个环切割成若干部分,每个部分不超过B,至少要切成几块? #i ...
- XJOI网上同步训练DAY6 T2
思路:记得FJ省队集训好像有过这题,可是我太弱了,根本不懂T_T #include<cstdio> #include<iostream> #include<cmath&g ...
- logstash tag使用说明
zjtest7-frontend:/usr/local/logstash-2.3.4/config# cat stdin04.conf input { stdin { } } filter { # d ...
- library cache: mutex X
我们先来看看 library cache: mutex X . 是个什么东西 The library cache mutex is acquired for similar purposes that ...