首页 > Web开发 > 详细

jQuery日期和时间插件(转)

时间:2015-03-09 18:55:42      阅读:367      评论:0      收藏:0      [点我收藏+]

jQuery UI Datepicker日期选择插件很好用了,只不过只能精确到日,不能选择时间(小时分钟秒)很遗憾,而jquery-ui-timepicker-addon.js正是基于jQuery UI Datepicker的一款可选时间的插件。

官网地址:http://trentrichardson.com/examples/timepicker/

官网demo下载:https://github.com/trentrichardson/jQuery-Timepicker-Addon

效果图

技术分享

DEMO

 

<!doctype html>
<html lang="us">
<head>
    <meta charset="utf-8">
    <title>jQuery UI Example Page</title>
    <link href="jquery-ui.css" rel="stylesheet">

</head>
<body>
<!-- Datepicker -->
<h2 class="demoHeaders">Datepicker</h2>
<div id="datepicker"></div>

<input type="text" id="datetime" name="datetime" value="" />

<script src="external/jquery/jquery.js"></script>
<script src="jquery-ui.js"></script>
<script src="jquery-ui-timepicker-addon.js"></script>

<script>

$("#datetime").datetimepicker(); // 日期+时分秒
$("#datetime").datepicker(option, {dateFormat: yy/mm/dd}); // 日期
$("#datetime").timepicker(); // 时分秒


$( "#datepicker" ).datepicker({
    inline: true
});

</script>
</body>
</html>

 

参考来源:http://blog.csdn.net/sunbiao0526/article/details/8176794

http://www.cnblogs.com/stone_w/archive/2012/11/22/2783044.html

 

jQuery日期和时间插件(转)

原文:http://www.cnblogs.com/keitho00/p/4324217.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!