1、基本使用

<link href="@Url.Content("~/C  ontent/kendo/2014.1.318/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.default.min.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/kendo/2014.1.318/jquery.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/kendo/2014.1.318/kendo.web.min.js")" type="text/javascript"></script>
<input id="datePicker" />
<script type="text/javascript">
$(function () {
$("#datePicker").kendoDatePicker();
});
</script>

  效果预览:

  2、设置日期格式

<script type="text/javascript">
$(function () {
$("#datePicker").kendoDatePicker({
format: "yyyy-MM-dd"
});
});
</script>

  3、初始化当前日期

<script type="text/javascript">
$(function () {
$("#datePicker").kendoDatePicker({
format: "yyyy-MM-dd",
value: new Date()
});
});
</script>

  4、设置本地化

<script src="@Url.Content("~/Scripts/kendo/2014.1.318/cultures/kendo.culture.zh-CN.min.js")" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
kendo.culture("zh-CN");
$("#datePicker").kendoDatePicker({
format: "yyyy-MM-dd",
value: new Date()
});
});
</script>

  效果预览:

  5、设置日期选择范围

Start Date:<input id="start" />
End Date:<input id="end" />
<script type="text/javascript">
$(function () {
function startChange() {
var startDate = start.value(),
endDate = end.value(); if (startDate) {
startDate = new Date(startDate);
startDate.setDate(startDate.getDate());
end.min(startDate);
} else if (endDate) {
start.max(new Date(endDate));
} else {
endDate = new Date();
start.max(endDate);
end.min(endDate);
}
} function endChange() {
var endDate = end.value(),
startDate = start.value(); if (endDate) {
endDate = new Date(endDate);
endDate.setDate(endDate.getDate());
start.max(endDate);
} else if (startDate) {
end.min(new Date(startDate));
} else {
endDate = new Date();
start.max(endDate);
end.min(endDate);
}
} var start = $("#start").kendoDatePicker({
format: "yyyy-MM-dd",
change: startChange
}).data("kendoDatePicker"); var end = $("#end").kendoDatePicker({
format: "yyyy-MM-dd",
change: endChange
}).data("kendoDatePicker"); start.max(end.value());
end.min(start.value());
});
</script>

  效果预览:

  6、参考资料

  http://demos.telerik.com/kendo-ui/datepicker/index

KendoUI系列:DatePicker的更多相关文章

  1. KendoUI系列:Window

    1.基本使用 <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css") ...

  2. KendoUI系列:MultiSelect

    1.基本使用 1>.创建Input <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common. ...

  3. KendoUI系列:DropDownList

    1.基本使用 1>.创建Input <input id="dropDownList" /> <link href="@Url.Content(&q ...

  4. [转]KendoUI系列:Grid

    本文转自:http://www.cnblogs.com/libingql/p/3774879.html 1.基本使用 <div id="grid"></div&g ...

  5. KendoUI系列:TreeView

    1.加载本地数据 <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css" ...

  6. KendoUI系列:TabStrip

    <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css")" ...

  7. KendoUI系列:PanelBar

    <link href="@Url.Content("~/Content/kendo/2014.1.318/kendo.common.min.css")" ...

  8. KendoUI系列:AutoComplete

    1.基本使用 <link href="@Url.Content("~/C ontent/kendo/2014.1.318/kendo.common.min.css" ...

  9. KendoUI系列:Grid

    1.基本使用 <div id="grid"></div> <link href="@Url.Content("~/Content/ ...

随机推荐

  1. [ImportNew] Perforce - Restoring Mistakenly Deleted Files in Workspace

    Shit happens when you accidentally delete some files in your workspace and you have no ideas which o ...

  2. 使用ASP.NET MVC操作过滤器记录日志(转)

    使用ASP.NET MVC操作过滤器记录日志 原文地址:http://www.singingeels.com/Articles/Logging_with_ASPNET_MVC_Action_Filte ...

  3. ubuntu安装hexo博客

    ubuntu下安装hexo博客 一 安装git sudo apt-get install git 二 安装nodejs 官网下载linux安装包.tar.gz文件 解压 tar zxvf 这样变可以切 ...

  4. 第五章GPIO接口

    5.1 GPIO硬件介绍 可以不通过他们输出高低电平或者通过它们读入应交的状态 S3C2410有117个I/O端口,分为A~H共8组:GPA.GPB....GPH S3C2440有130个I/O端口, ...

  5. 对bit、byte、TByte、Char、string、进制的认识

    在学校老师就教1byte = 8bit,一个Byte在内存中占8个房间.每个房间都有门牌号.找到内存中的内容就找门牌号,寻址什么的,虽然在听,但是脑袋里一头雾水,到现在只知道会用就行,但原理也不是那么 ...

  6. The Rotation Game(IDA*算法)

    The Rotation Game Time Limit : 30000/15000ms (Java/Other)   Memory Limit : 300000/150000K (Java/Othe ...

  7. python 多线程和多进程基本写法

    #coding=utf-8 def aJob(arg): """ 提供给多线程调用 """ import threading t = thr ...

  8. storysnail的Linux串口编程笔记

    storysnail的Linux串口编程笔记 作者 He YiJun – storysnail<at>gmail.com 团队 ls 版权 转载请保留本声明! 本文档包含的原创代码根据Ge ...

  9. 用StackExchange.Redis客户端连接阿里云Redis服务遇到的问题

    阿里云推荐的Redis服务.NET客户端是ServiceStack.Redis,但ServiceStack.Redis不支持异步,不支持.NET Core,于是尝试使用StackExchange.Re ...

  10. Dojo动画原理解析

    dojo中动画部分分为两部分:dojo/_base/fx, dojo/fx.dojo/_base/fx部分是dojo动画的基石,里面有两个底层API:animateProperty.anim和两个常用 ...