Home  >  Article  >  Web Front-end  >  How to use JS replacement and time plug-in together_javascript skills

How to use JS replacement and time plug-in together_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:29:401301browse


[Ctrl A select all Note: If you need to introduce external Js, you need to refresh 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').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));
                                                                                                             
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn