laydate
laydate copied to clipboard
增加配置项,使日期选择更加灵活
使用方法配置项中新增以下参数
notAllowDays: ['2018-10-08', '2018-10-19', '2018-10-18']
allowDays: ['2018-10-08', '2018-10-19', '2018-10-18']
notAllowDays 不允许选择日期
allowDays 仅支持选择日期
应用场景
- 节假日选择或排除
- 业务场景需求在min:-7 到max:7再排除周末
- 根据接口允许选择指定日期
confirm: function(){ if(options.range){ if(!that.endDate) return that.hint('请先选择日期范围'); if(lay(btn).hasClass(DISABLED)) return that.hint( options.type === 'time' ? TIPS_OUT.replace(/日期/g, '时间') : TIPS_OUT ); } else { if(lay(btn).hasClass(DISABLED)) return that.hint('不在有效日期或时间范围内'); } that.done(); that.setValue(that.parse()).remove() } };
这里,在done中无法重新赋值,建议把that.done(); 放到 that.setValue(that.parse()).remove() 后面