您的位置:首页 > Web前端 > JavaScript

JS 替换和时间插件的结合使用方法

2018-10-12 13:59 836 查看


// 日期
    $('.date').datepicker({
        changeYear: true,
        changeMonth: true,
        minDate:null,
        maxDate:null,
        onClose: function(selectedDate) {
            $('.gap-date').datepicker('option','minDate', '+1m');
        }
    });

    // 日期范围
    $('.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));
        }
    });

您可能感兴趣的文章:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: