梧枫 发表于 2013-1-4 03:02:03

jquery ui datepicker demo

<div id="cnblogs_post_body">演示地址:http://jsfiddle.net/NGQQ2/45/
.datepicker("setDate" ,(new Date)); // 非内嵌面板,初始化input日期​
-------------------------------------------
js代码(最新代码见演示地址):
<div class="cnblogs_code"> 1 /* Chinese initialisation for the jQuery UI date picker plugin. */ 2 /* Written by Cloudream (cloudream@gmail.com). */ 3 jQuery(function($){ 4   $.datepicker.regional['zh-CN'] = { 5         closeText: '关闭', 6         prevText: '<上月', 7         nextText: '下月>', 8         currentText: '今天', 9         monthNames: ['一月','二月','三月','四月','五月','六月',10         '七月','八月','九月','十月','十一月','十二月'],11         monthNamesShort: ['一月','二月','三月','四月','五月','六月',12         '七月','八月','九月','十月','十一月','十二月'],13         dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],14         dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],15         dayNamesMin: ['日','一','二','三','四','五','六'],16         weekHeader: '周',17         dateFormat: 'yy-mm-dd',18         firstDay: 1,19         isRTL: false,20         showMonthAfterYear: true,21         yearSuffix: '年'};22   $.datepicker.setDefaults($.datepicker.regional['zh-CN']);23 });24 25 // -----------------------------26 27 28 29 //debugger;30 //$( "#datepicker" )31 $( "#datepicker" ).datepicker({ 32   altField: "#dateUpdate", // 同步日期至该文本框33   autoSize: true ,         //???34   showButtonPanel: true ,// 显示按钮面板,包括 “今天” “关闭”35   gotoCurrent: true,       //???36   37   //defaultDate: +7,       // 默认显示日期38   firstDay: 2,             //???39   40   /* 选择约束 */41   minDate: new Date(),   // 最小日期42   hideIfNoPrevNext: true,// 当设置了最小日期\最大日期,且符合条件时隐藏导航按钮43   44   /* 导航类 */45   navigationAsDateFormat: true,46   showOtherMonths: true,   // 是否在面板的空余格子中显示临近的月份的日子47   selectOtherMonths: false, // 相邻的月份的日子是否可选 48   stepMonths: 1,         // 一次翻一个月49   changeMonth: true,       // 可使用下拉列表改变月份50   //changeYear: true,      // 可使用下拉列表改变年份51   52   /* 多面板 */53   numberOfMonths: [ 1, 2 ],// 一次显示 a * b 个月的日期,展现为a行b列54   showCurrentAtPos: 0,   // 显示多月时,设置在第几个面板显示当月。和 changeMonth 冲突?(下拉只能显示在第一个面板)55   56   /* 面板展现 */57   showAnim: "fold",      // 折叠的方式展开,非内嵌时才管用58   59   /* 国际化\自定义文本配置 */60   closeText: "关闭",61   yearSuffix: "年",62   //prevText: ""63   nextText: "下一月",64   65   /* 周数 */66   showWeek: true,          // 是否显示该年周数67   weekHeader: "周"         // 周数列表头名称68   69 });​
页: [1]
查看完整版本: jquery ui datepicker demo