jQuery UI Datepicker&Datetimepicker添加 时-分-秒 并且,判断
jQuery UI Datepicker时间(年-月-日)

相关代码:
<input type="text" value="" name="adv_start_time" id="adv_start_time" class="txt date">
<script type="text/javascript" src="xxxx路径/jquery.ui.js"></script>
<link rel="stylesheet" type="text/css" href="xxxx路径/jquery.ui.css" />
<script type="text/javascript">
$(function(){
$('#adv_start_time').datetimepicker({
controlType: 'select'
});
});
</script>
jQuery UI datetimepicker时间(年-月-日-分-秒)

<input type="text" value="" name="adv_start_time" id="adv_start_time" class="txt date"></td>
<script type="text/javascript" src="xxxx路径/jquery.ui.js"></script>
<link rel="stylesheet" type="text/css" href="xxxx路径/jquery.ui.css" />
<script src="xxxxxxxx路径/jquery-ui-timepicker-addon.min.js"></script>
<link rel="stylesheet" type="text/css" href="xxxxx路径/jquery-ui-timepicker-addon.min.css" />
<script type="text/javascript">
$(function(){
$('#adv_start_time').datetimepicker({
controlType: 'select'
});
});
</script>
jQuery UI 下载
一旦您对 jQuery UI 有了基本了解,您就可以亲自尝试一下。请从 jQuery UI 网站上的 Download Builder(下载生成器) 页面下载 jQuery UI 的副本。
延伸,假如存在时间的限制

<script>
$(document).ready(function(){
<?php if(empty($output['xianshi_info'])) { ?>
$('#start_time').datetimepicker({
controlType: 'select'
}); $('#end_time').datetimepicker({
controlType: 'select'
});
<?php } ?> jQuery.validator.methods.greaterThanDate = function(value, element, param) {
var date1 = new Date(Date.parse(param.replace(/-/g, "/")));
var date2 = new Date(Date.parse(value.replace(/-/g, "/")));
return date1 < date2;
};
jQuery.validator.methods.lessThanDate = function(value, element, param) {
var date1 = new Date(Date.parse(param.replace(/-/g, "/")));
var date2 = new Date(Date.parse(value.replace(/-/g, "/")));
return date1 > date2;
};
jQuery.validator.methods.greaterThanStartDate = function(value, element) {
var start_date = $("#start_time").val();
var date1 = new Date(Date.parse(start_date.replace(/-/g, "/")));
var date2 = new Date(Date.parse(value.replace(/-/g, "/")));
return date1 < date2;
}; //页面输入内容验证
$("#add_form").validate({
errorPlacement: function(error, element){
var error_td = element.parent('dd').children('span');
error_td.append(error);
},
onfocusout: false,
submitHandler:function(form){
ajaxpost('add_form', '', '', 'onerror');
},
rules : {
xianshi_name : {
required : true
},
start_time : {
required : true,
greaterThanDate : '<?php echo date('Y-m-d H:i',$output['current_xianshi_quota']['start_time']);?>'
},
end_time : {
required : true,
<?php if (!$output['isOwnShop']) { ?>
lessThanDate : '<?php echo date('Y-m-d H:i',$output['current_xianshi_quota']['end_time']);?>',
<?php } ?>
greaterThanStartDate : true
}
},
messages : {
xianshi_name : {
required : '<i class="icon-exclamation-sign"></i><?php echo $lang['xianshi_name_error'];?>'
},
start_time : {
required : '<i class="icon-exclamation-sign"></i><?php echo sprintf($lang['xianshi_add_start_time_explain'],date('Y-m-d H:i',$output['current_xianshi_quota']['start_time']));?>',
greaterThanDate : '<i class="icon-exclamation-sign"></i><?php echo sprintf($lang['xianshi_add_start_time_explain'],date('Y-m-d H:i',$output['current_xianshi_quota']['start_time']));?>'
},
end_time : {
required : '<i class="icon-exclamation-sign"></i><?php echo sprintf($lang['xianshi_add_end_time_explain'],date('Y-m-d H:i',$output['current_xianshi_quota']['end_time']));?>',
<?php if (!$output['isOwnShop']) { ?>
lessThanDate : '<i class="icon-exclamation-sign"></i><?php echo sprintf($lang['xianshi_add_end_time_explain'],date('Y-m-d H:i',$output['current_xianshi_quota']['end_time']));?>',
<?php } ?>
greaterThanStartDate : '<i class="icon-exclamation-sign"></i><?php echo $lang['greater_than_start_time'];?>'
}
}
});
});
</script>
jQuery UI Datepicker&Datetimepicker添加 时-分-秒 并且,判断的更多相关文章
- JQuery UI datepicker 使用方法(转)
官方地址:http://docs.jquery.com/UI/Datepicker,官方示例: http://jqueryui.com/demos/datepicker/. 一个不错的地址,用来DIY ...
- 页面日期选择控件--jquery ui datepicker 插件
日期选择插件Datepicker是一个配置灵活的插件,我们可以自定义其展示方式,包括日期格式.语言.限制选择日期范围.添加相关按钮以及其它导航等.官方地址:http://docs.jquery.com ...
- 坑爹的jquery ui datepicker
1.坑爹的jquery ui datepicker 竟然不支持选取时分秒,害的我Format半天 期间尝试了bootstrap的ditepicker,但是不起作用,发现被jquery ui 覆盖了, ...
- jQuery UI Datepicker使用介绍
本博客使用Markdown编辑器编写 在企业级web开发过程中,日历控件和图表控件是使用最多的2中第三方组件.jQuery UI带的Datepicker,日历控件能满足大多数场景开发需要.本文就主要讨 ...
- jQuery UI datepicker z-index默认为1 怎么处理
最近在维护一个后台系统的时候遇到这样的一个坑:后台系统中日期控件使用的是jQuery UI datepicker. 这个控件生成的日期选择框的z-index = 1.问题来了.页面上有不少z-inde ...
- JS实现倒计时(天数,时,分,秒)
<!DOCTYPE html> <html> <head> <meta charset="utf-8" > <titl ...
- [转]Using the HTML5 and jQuery UI Datepicker Popup Calendar with ASP.NET MVC - Part 4
本文转自:http://www.asp.net/mvc/overview/older-versions/using-the-html5-and-jquery-ui-datepicker-popup-c ...
- 第一好用的时间 日期插件(Adding a Timepicker to jQuery UI Datepicker)
最近在一个项目中用到了My97DatePicker,国人写的一个挺不错的时间选择插件,简单易用,但是在调试静态时却发现此插件必须产生一个iframe标签指向其主页,试了很多种方法都不能去除 ...
- 解决 jQuery UI datepicker z-index默认为1 的问题
最近碰到页面日期选择控件被页头挡住的问题,我们这个客户的电脑是宽屏的,上下窄,屏幕又小,导致他点击日期选择控件时,无法选择到月份.如图: 分析造成这个问题的原因: 我们页头部分的z-index设置为1 ...
随机推荐
- 微信分享jssdk config:invalid signature 签名错误
使用微信分享时,按照官方给的demo,使用时一直提示签名错误. 根据微信开发文档(http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd ...
- linux系统结构和系统命令初步
以上是第五课和第14课笔记 linux 基本结构: 系统构成:kernel,Modules,Lib,(Shell,Tool)系统引导:BIOS -> Bootlooder -> Kerne ...
- Even Tree
Link: https://www.hackerrank.com/challenges/even-tree def search(a,b): # 根据核心算法和题目要求要筛选边 seen = {} s ...
- Qt编程之实现在QFileDialog上添加自定义的widget
上网搜索找到的方法如下: http://www.qtforum.org/article/20841/how-to-add-a-qwidget-in-qfiledialog.html#post78422 ...
- [科普]MinGW vs MinGW-W64及其它
转载:http://tieba.baidu.com/p/3186234212?pid=54372018139&cid=#54372018139 这里也转一下吧. 部分参照备忘录原文: bitb ...
- linux awk 使用
awk是linux下的一个命令,他对其他命令的输出,对文件的处理都十分强大,其实他更像一门编程语言,他可以自定义变量,有条件语句,有循环,有数组,有正则,有函数等.他读取输出,或者文件的方式是一行,一 ...
- UML--一些图
通过UML来表示汽车,简洁明了. 统一建模语言--UML. 参与者Actor,参与者代表了现实世界的人.人. 用例use case,就是参与者要做什么并且获得什么.事. 业务场景,用例场景.规则. 业 ...
- 【转】将 Linux 应用程序移植到 64 位系统上
原文网址:http://www.ibm.com/developerworks/cn/linux/l-port64.html 随着 64 位体系结构的普及,针对 64 位系统准备好您的 Linux® 软 ...
- Uva 1342 - That Nice Euler Circuit
Little Joey invented a scrabble machine that he called Euler, after the great mathematician. In his ...
- C#中通过位运算实现多个状态的判断
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...