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 ...
随机推荐
- C语言学习中容易模糊的一些概念
1.什么叫分配内存 操作系统把某一块内存空间的使用权利分配给该程序 2.释放内存 操作系统把分配给该程序的内存空间的使用权利收回,该程序就不能再使用这块内存空间 注:释放内存空间并不是把这块内存的数据 ...
- DSASync: Managing End-to-End Connections in Dynamic Spectrum Access Wireless LANs
其实跟上一篇是同一篇文章.不过上一篇是发表在IEEE Secon2010了,这篇是后来又增加了部分内容后的一版,收录在IEEE/ACM TRANSACTIONS ON NETWORKING, VOL. ...
- C语言 中缀转后缀
给定字符串型的算术表达式,实现中缀转后缀并运算得出结果: #ifndef STACK_H_INCLUDED #define STACK_H_INCLUDED #include <stdio.h& ...
- iPhone 和Android应用,特殊的链接:打电话,短信,email;
http://ice-k.iteye.com/blog/1426526 下面的这篇文章主要是说,网页中的链接如何写,可以激活电话的功能. 例如,页面中展示的是一个电话号码,当用户在手机浏览器里面点击这 ...
- hdu 2473 Junk-Mail Filter
http://acm.hdu.edu.cn/showproblem.php?pid=2473 并查集设置虚拟父节点. #include <cstdio> #include <cstr ...
- Keil C51 知识点
第一节 Keil C51扩展关键字 深入理解并应用C51对标准ANSIC的扩展是学习C51的关键之一.因为大多数扩展功能都是直接针对8051系列CPU硬件的.大致有以下8类: 8051存储类型 ...
- Hive 5、Hive 的数据类型 和 DDL Data Definition Language)
官方帮助文档:https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL Hive的数据类型 -- 扩展数据类型data_t ...
- WPF页面切换及弹窗
WPF页面切换及弹窗 结构如图: 效果如图: 代码如下: xaml <Window x:Class="PageChange.MainWindow" xmlns="h ...
- Java单元测试:@BeforeClass,@Before,@Test,@After,@AfterClass中的问题详解
在Junit4中还有的测试注解有: @BeforeClass ,@Before,@Test,@After,@AfterClass 1.其中:@BeforeClass,@AfterClass是Juni ...
- 如何在编译内核时添加缺少的固件(随着intel wireless 5100 AGN的 iwlwifi 案例)
我不知道你在笔记本使用 Linux 在内核编译无线wifi 不能用.我的书"关联 Y450"一个足够的旧书,随着无线网卡: $ lspci | grep Wireless 06:0 ...