Bootstrap datetimepicker2.3.11 time plugin using _javascript tips

Source: Internet
Author: User

This article has shared the bootstrap DateTimePicker use method for everybody, the concrete content as follows

The time plugin's end time cannot be less than the start time

Changedate:function (starttime,stoptime) {      //judge the size of the time window prompts the user
 var _t = this;
  if (stoptime!= ' && starttime!= ') {
   if (StopTime < StartTime) {
    $ (' #stop-date '). Val (');
    $ (' #time '). Modal (' show ');
    settimeout (function () {($ (' #time '). Modal (' hide '))},3000);
    return;}}
 ,
 Timedatapicker:function () {var _t = this;       This var startdate = $ (' #start-date '),//start time Stopdate = $ (' #stop-date '); End time Startdate.datetimepicker ({format: ' Yyyy-mm-dd ', autoclose:true, minview:2, language: ' ZH-CN '}). On (the ' Change ', function () {//changedata method is written after the change to prevent Changedata from having Changge methods (avoid collisions) var starttime = Startdate.val (
   );
   var stoptime = Stopdate.val ();
   _t.changedate (Starttime,stoptime); Stopdate.datetimepicker (' setstartdate ', starttime);
   The selection of the end time is based on the selected start time (equal to start time)). On (' ChangeDate ', function () {var starttime = Startdate.val (); Stopdate.datetimepicker (' setstartdate ', starttime);
  The selection of the end time will be based on the selected start time (equal to start time) var stoptime = Stopdate.val ();

  }); Stopdate.datetimepicker ({format: ' Yyyy-mm-dd ', autoclose:true, minview:2, language: ' ZH-CN '}). On (' Change '
   , function () {var starttime = Startdate.val ();
var stoptime = Stopdate.val ();   _t.changedate (starttime,stoptime,$ (this));
   ). On (' ChangeDate ', function () {var starttime = Startdate.val ();
   var stoptime = Stopdate.val ();
   Startdate.datetimepicker (' setenddate ', stoptime);
  Stopdate.datetimepicker (' setstartdate ', starttime);

 }); },

If you want to further study, you can click here to learn, and then attach 3 wonderful topics:

Bootstrap Learning Course

Bootstrap Practical Course

Bootstrap Plugin Usage Tutorial

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.