JQuery UI Datepicker&datetimepicker added-minute-second and, judging

Source: Internet
Author: User
Tags date1 echo date sprintf jquery ui datepicker

JQuery UI DatePicker time (year-month-day)

Related code:

class= "txt Date" >

<script type= "Text/javascript" src= "xxxx path/jquery.ui.js" ></script>
<link rel= "stylesheet" type= "Text/css" href= "xxxx path/jquery.ui.css"/>

<script type= "Text/javascript" >$ (function() {$ (' #adv_start_time ').  DateTimePicker ({       controltype: ' Select '     }) ; </script>
JQuery UI DateTimePicker Time (year-month-day-minute-second)

class= "txt Date" ></td>
<script type= "Text/javascript" src= "xxxx path/jquery.ui.js" ></script>
<link rel= "stylesheet" type= "Text/css" href= "xxxx path/jquery.ui.css"/><script src= "xxxxxxxx Path/ Jquery-ui-timepicker-addon.min.js "></script><link rel=" stylesheet "type=" Text/css "href=" xxxxx Path/ Jquery-ui-timepicker-addon.min.css " /><script type=" Text/javascript ">$ (function () { $ (' #adv_start_time '). DateTimePicker ({ controltype: ' Select ' }) ; </script>
JQuery UIDownload

Once you have a basic understanding of the JQuery UI, you can try it yourself. Please download a copy of the jquery UI from the Download Builder (Download builder) page on the jquery UI website.

Extension, if there is a time limit

<script>$ (document). Ready (function(){    <?phpif(Empty($output[' Xianshi_info '])) {?>    $(' #start_time ').DateTimePicker ({controltype: ' SELECT '    }); $(' #end_time ').DateTimePicker ({controltype: ' SELECT '    }); <?php}?>JQuery. validator.methods.greaterThanDate =function(Value, Element,param) {        varDate1 =New Date(Date. Parse (Param.replace (/-/g, "/"))); varDate2 =New Date(Date. Parse (Value.replace (/-/g, "/"))); returnDate1 <Date2;    }; JQuery. validator.methods.lessThanDate =function(Value, Element,param) {        varDate1 =New Date(Date. Parse (Param.replace (/-/g, "/"))); varDate2 =New Date(Date. Parse (Value.replace (/-/g, "/"))); returnDate1 >Date2;    }; JQuery. validator.methods.greaterThanStartDate =function(Value,Element) {        varstart_date = $ ("#start_time").Val (); varDate1 =New Date(Date. Parse (Start_date.replace (/-/g, "/"))); varDate2 =New Date(Date. Parse (Value.replace (/-/g, "/"))); returnDate1 <Date2;    }; //page input Content validation$ ("#add_form").Validate ({errorplacement:function(Error,Element) {            varERROR_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, <?phpif(!$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 ']); > ', <?phpif(!$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 added-minute-second and, judging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.