laydate icon indicating copy to clipboard operation
laydate copied to clipboard

增加配置项,使日期选择更加灵活

Open yimijianfang opened this issue 6 years ago • 1 comments

使用方法配置项中新增以下参数 notAllowDays: ['2018-10-08', '2018-10-19', '2018-10-18'] allowDays: ['2018-10-08', '2018-10-19', '2018-10-18'] notAllowDays 不允许选择日期 allowDays 仅支持选择日期

应用场景

  1. 节假日选择或排除
  2. 业务场景需求在min:-7 到max:7再排除周末
  3. 根据接口允许选择指定日期

yimijianfang avatar Oct 18 '18 03:10 yimijianfang

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() 后面

web-inf0 avatar Nov 15 '18 13:11 web-inf0