This article mainly introduces the combination of JS replacement and time plug-in code. For more information, see
Script var d = '2017-07-21 '; var nd = d. replace (new RegExp ('-', 'G'), ','); // replace all documents. write (nd); document. write ('<br>'); var a = 'phper _ yang'; var aa =. replace ('_','. '); // replace document once. write (aa); script
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
The Code is as follows:
// Date
$ ('. Date'). datepicker ({
ChangeYear: true,
ChangeMonth: true,
MinDate: null,
MaxDate: null,
OnClose: function (selectedDate ){
$ ('. Gap-date'). datepicker ('option', 'mindate',' + 1m ');
}
});
// Date range
$ ('. Gap-date'). datepicker ({
ChangeYear: true,
ChangeMonth: true,
MaxDate: null,
OnClose: function (selectedDate ){
Var y, m, d;
Var arr = selectedDate. split ('-');
Y = arr [0];
M = arr [1]-7;
D = arr [2];
$ ('. Date'). datepicker ('option', 'maxdate', new date (y, m, d ));
}
});