Laydate Date plug-in case, end time less than start time not selectable

Source: Internet
Author: User
Tags getdate time limit

End time is less than start time is not selectable, minutes and today you can choose to display


Html:

        <span class= "FL" >
		<em> start time:</em>
		<input class= "Laydate-icon" name= "Begin_time" value= "" "Placeholder=" id= "Start" type= "text" >
	</span>
	<span class= "FL" >
		<em></ em>
		input class= "Laydate-icon" name= "End_time" value= "" placeholder= "End Time" id= "ends" type= "text" >
	</ Span>


Js:

  var start = {elem: ' #start ', format: ' Yyyy/mm/dd ',//Min:laydate.now (),///Start time limit date before today Istime:false,//whether displays the minute istoday:true,//whether displays today Choose:function (datas) {var now = new Date (Layda 
        Te.now (). Replace ("-", "/")); 
        var add=new Date (Datas.replace ("-", "/")); 
        add= New Date (Add.gettime () + 30*24*60*60*1000);  
        if (Now.getmonth () + 1) < (Add.getmonth () + 1)) {end.min = Laydate.now (); }else if (now.getmonth () + 1) = = (Add.getmonth () + 1) && now.getdate () <add.getdate ()) {end.min = L
        Aydate.now ();
            else {add=add.getfullyear () + "/" + (Add.getmonth () + 1) + "/" + add.getdate ();
        End.min = add;
      } end.min = Datas;
    }
    }; var end = {elem: ' #end ', format: ' Yyyy/mm/dd ', Min:laydate.now (), Istime:true, ISTODAY:FA LSE, Choose:function (datas) {var max=new DatE (Datas.replace ("-", "/")); 
        max= New Date (Max.gettime ()-30*24*60*60*1000); 
        Max=max.getfullyear () + "/" + (Max.getmonth () + 1) + "/" + max.getdate (); 
        Start.max = datas;
      Start.min = Laydate.now ();
    }
    };
    Laydate (start); Laydate (end);


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.