jQuery几种日期,时间选择插件.
一.使用bootstrap主题的jQuery日期选择插件
创新互联建站是专业的同安网站建设公司,同安接单;提供成都做网站、成都网站建设,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行同安网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!
bootstrap-datepicker.js
二.jQuery UI jQuery日期选择插件
datepicker,集成在jquery-ui.js内.
http://api.jqueryui.com/datepicker/
三.扩展了jQuery的datepicker插件,可以选择时间
jquery-ui-timepicker-addon.js
要先导入jquery-ui.js
https://github.com/trentrichardson/jQuery-Timepicker-Addon
四.jquery-ui-timepicker-addon 用法
html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" href="/static/app1/css/jquery-ui.css" rel="stylesheet"/>
<link type="text/css" href="/static/app1/css/jquery-ui-timepicker-addon.css" rel="stylesheet"/>
<script src="/static/app1/js/jquery-3.1.0.js">script>
<script type="text/javascript" src="/static/app1/js/jquery-ui.js">script>
<script type="text/javascript" src="/static/app1/js/jquery-ui-timepicker-addon.js">script>
<script type="text/javascript" src="/static/app1/js/jquery-ui-timepicker-zh-CN.js">script>
head>
<body>
<form>
<input title="你好" id="timepicker" value="点击弹出选择框">
form>
<script>
var conf = {
//buttonImageOnly: true,
changeYear: true,
changeMonth: true,
selectOtherMonths: false,
showSecond: false,
dateFormat: 'yy-mm-dd',
timeFormat: 'HH:mm:ss',
stepHour: 1,
stepMinute: 1,
hourMax: 20,
hourMin: 9
};
$('#timepicker').datetimepicker(conf);
script>
body>
html>
jquery-ui-timepicker-zh-CN.js 汉化新加了monthNamesShort和monthNames,
(function($) {
$.timepicker.regional['zh-CN'] = {
timeOnlyTitle: '选择时间',
timeText: '时间',
hourText: '小时',
minuteText: '分钟',
secondText: '秒钟',
millisecText: '毫秒',
microsecText: '微秒',
timezoneText: '时区',
currentText: '现在时间',
closeText: '确认',
timeFormat: 'HH:mm',
timeSuffix: '',
amNames: ['AM', 'A'],
pmNames: ['PM', 'P'],
isRTL: false,
monthNamesShort: [ "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" ],
monthNames: [ "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" ]
};
$.timepicker.setDefaults($.timepicker.regional['zh-CN']);
})(jQuery);
网站题目:jQuery几种日期,时间选择插件.
网页链接:http://scyanting.com/article/iehssp.html