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. hdu acm 1028 数字拆分Ignatius and the Princess III

    Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K ...

  2. 7.4 MVC vs MVP

    MVC(Model_view_contraller)"模型_视图_控制器". MVC应用程序总是由这三个部分组成.Event(事件)导致Controller改变Model或View ...

  3. ubuntu上搭建review board代码评审站点

    Reviewboard是一个开源个人可以免费使用的代码评审框架,貌似现在有越来越多的公司也开始使用reviewboard作为公司的代码评审工具. 今天早上试了一下,搭建过程非常方便简单,按照网页提示即 ...

  4. 浅谈Swift集合类型

    Swift 的集合表现形式由数组和字典组成.它可以完美的存储任何呢想存储的东西. 数组是一个同类型的序列化列表集合,它用来存储相同类型的不同值.字典也是一个数组,但它的存值方式类似于Map,通过一对一 ...

  5. Linux初记

    ctrl+u可以在shell下删除行,如果此键不起作用,就试试ctrl+x ctrl+z可以将程序挂起,不会终止程序,但可以将程序挂起. 通过fg命令可再把此作业切换到前台 cp命令的目标文件如果是一 ...

  6. delphi 屏幕截屏

    function GetScreenAll: TBitmap; // 截取全屏 var C: TCanvas; begin C := TCanvas.Create; result := TBitmap ...

  7. .Net下的 ORM框架介紹

    在.NET平台下,关于数据持久层框架非常多,本文主要对如下几种做简要的介绍并推荐一些学习的资源: 1.NHibernate 2.NBear 3.Castle ActiveRecord 4.iBATIS ...

  8. bzoj 3110

    题意:戳这里 思路:可以用cdq分治(很明显这种模型妹纸分治法很解决)..不过为了学习树套树特地写了一下.. 所谓的树套树也第一层(最外层)普通的维护的是一个node,而树套树维护的是一个数据结构(一 ...

  9. hibernate常用API详解

    根据个人使用Hibernate的经验,介绍一下Hibernate的多种不同的查询和CUD操作,这些东西在日常开发中非常常用,希望对大家有所帮助. 以下示例均以两张表为例:member和userinfo ...

  10. 扫描二维码判断移动设备(Android/ios),以及判断是否微信端扫描

    <section class="download"> <a href="apk地址" class="android" st ...