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