本文主要是介绍jquery 的日期时间控件(年月日时分秒),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
控件的外观很漂亮,但是需要导入几个jquery的包才行,在IE6中运行稍微有些慢[b]注:例子中出现的jquery-ui-1.7.3是jquery的插件,包含了日期控件的国际化和一些动画特效[/b],下载地址:[url]http://jqueryui.com/[/url]
<!-- import package -->
<script type="text/javascript" src="JS/jquery.js"></script>
<script type="text/javascript" src="JS/jquery-ui-1.7.3/ui/jquery-ui-1.7.3.custom.js"></script>
<script type="text/javascript" src="JS/jquery-ui-1.7.3/ui/ui.datepicker.js"></script>
<script type="text/javascript" src="JS/jquery-ui-timepicker-addon.js"></script>
<link type="text/css" href="CSS/jquery-ui-1.7.3/redmond/jquery-ui-1.7.3.custom.css" rel="stylesheet" />
<script type="text/javascript">
$('#dyStartDateTime').datetimepicker({
showSecond: true,
changeMonth: true,
changeYear: true,
timeFormat: 'hh:mm:ss',
dateFormat: 'yy-mm-dd'
});
$('#dyEndDateTime').datetimepicker({
showSecond: true,
changeMonth: true,
changeYear: true,
timeFormat: 'hh:mm:ss',
dateFormat: 'yy-mm-dd'
});
</script>
这篇关于jquery 的日期时间控件(年月日时分秒)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!