jQuery日期选择器插件jquery.date_input.js
官网:http://jonathanleighton.com/projects/date-input/
示例下载:jQuery日期选择器插件jquery.date_input.js
下载:
http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js
http://github.com/jonleighton/date_input/raw/master/jquery.date_input.js
http://github.com/jonleighton/date_input/raw/master/date_input.css
中文支持:
说明:默认是日期格式很不好,需要修改。
全部代码:
效果截图:
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312" />
<title>jQuery日期选择器插件jquery.date_input.js</title>
<script src="http://libs.baidu.com/jquery/1.7.2/jquery.js"></script>
<script type="text/javascript" language="javascript" src="/demo/20141009/001/jquery.date_input.js"></script>
<script type="text/javascript">
$(function() {
$("#date").date_input()
});
jQuery.extend(DateInput.DEFAULT_OPTS, {
month_names: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
short_month_names: ["一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"],
short_day_names: ["日", "一", "二", "三", "四", "五", "六"]
});
$.extend(DateInput.DEFAULT_OPTS, {
stringToDate: function(string) {
var matches;
if (matches = string.match(/^(\d{4,4})-(\d{2,2})-(\d{2,2})$/)) {
return new Date(matches[1], matches[2] - 1, matches[3])
} else {
return null
}
},
dateToString: function(date) {
var month = (date.getMonth() + 1).toString();
var dom = date.getDate().toString();
if (month.length == 1) month = "0" + month;
if (dom.length == 1) dom = "0" + dom;
return date.getFullYear() + "-" + month + "-" + dom
}
});
</script>
</head>
<body>
<input name="date" id="date" type="text" />
</body>
</html>
相关文章
- 调用百度CDN提供的jQuery库来加速网站
CDN公共库是指将常用的JS库存放在CDN节点,以方便广大开发者直接调用。与将JS库存放在服务器单机上相比,CDN公共库更加稳定、高速。 百度公共CDN为您的应用程序提供稳定、可靠、高速的服务,包含全球所有最流行的开源JavaScript库。 使用方法: 加载JS库,复
- 很棒的网站底部导航条效果
很棒的网站底部导航条效果,访客输入咨询信息点击发送按钮时可以向商务通传递访客输入的信息。 打包下载: 很棒的网站底部导航条效果 效果截图:
- jQuery日期选择器插件jquery.date_input.js
官网: http://jonathanleighton.com/projects/date-input/ 下载: http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js http://github.com/jonleighton/date_input/raw/master/jquery.date_input.js http://github.com/jonleighton/date_inpu
- jQuery火箭上升回到顶部效果
jQuery火箭上升回到顶部效果,jQuery模拟火箭升空的效果使网页回到顶部,效果逼真。 代码打包下载: jQuery火箭上升回到顶部效果 效果截图:
- jQuery实现的返回顶部功能
jQuery实现的返回顶部功能
随机推荐
- 调用百度CDN提供的jQuery库来加速网站
CDN公共库是指将常用的JS库存放在CDN节点,以方便广大开发者直接调用。与将JS库存放在服务器单机上相比,CDN公共库更加稳定、高速。 百度公共CDN为您的应用程序提供稳定、可靠、高速的服务,包含全球所有最流行的开源JavaScript库。 使用方法: 加载JS库,复
- 很棒的网站底部导航条效果
很棒的网站底部导航条效果,访客输入咨询信息点击发送按钮时可以向商务通传递访客输入的信息。 打包下载: 很棒的网站底部导航条效果 效果截图:
- jQuery日期选择器插件jquery.date_input.js
官网: http://jonathanleighton.com/projects/date-input/ 下载: http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js http://github.com/jonleighton/date_input/raw/master/jquery.date_input.js http://github.com/jonleighton/date_inpu
- jQuery火箭上升回到顶部效果
jQuery火箭上升回到顶部效果,jQuery模拟火箭升空的效果使网页回到顶部,效果逼真。 代码打包下载: jQuery火箭上升回到顶部效果 效果截图:
- jQuery实现的返回顶部功能
jQuery实现的返回顶部功能