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.