Home > Web Front-end > HTML Tutorial > DateTimePicker时间控件:_html/css_WEB-ITnose

DateTimePicker时间控件:_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:17:15
Original
1510 people have browsed it

DateTimePicker 时间控件:

http://xdsoft.net/jqplugins/datetimepicker/

可以参考文档设置各种属性,格式。

用法:

首先下载datetimepicker-master。

1.页面引入css,js文件(注意要放到body之后):

<!-- this should go after your </body> --><link rel="stylesheet" type="text/css"    href="/microshop-settlement-server/resources/datetimepicker-master/jquery.datetimepicker.css" /><script    src="/microshop-settlement-server/resources/datetimepicker-master/jquery.js"></script><script    src="/microshop-settlement-server/resources/datetimepicker-master/build/jquery.datetimepicker.full.min.js"></script>
Copy after login

2.点击文本框弹出日历选项:

Html:

<input  id="datetimepicker" type="text" name="createTime" value="<fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${createTime }"/>" maxlength="20"/>
Copy after login

这里用到了jsp el标签fmt:所以页面要先引入:

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
Copy after login

JavaScript:

<script type="text/javascript">    jQuery('#datetimepicker').datetimepicker({        format:'Y-m-d H:i:s'      //这是设置日历格式    });</script>
Copy after login

http://php.net/manual/ru/function.date.php(时间格式可以参考这个,如2009-01-01 10:00:01)

3.目录结构:

4.demo预览:

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template