功能介绍:支持中英文,支持只选年、只选日、只选月
具体压缩包下载请查看:https://download.youkuaiyun.com/download/qq_37541486/12837231
功能样式参考:
调用方法:
//如想只选年可修改 startView,maxViewMode,minViewMode(0-日,1月,2年)
_this.startView = 0; //组件默认显示日
_this.maxViewMode = 2;//组件最大显示年
_this.minViewMode = 0;//组件最小显示日
_this.fs = 'YYYY-MM-DD';//如果要 只选年则修改为'YYYY' 如果要 只选月则修改为 'YYYY-MM'
_this.dataFs = 'yyyy-mm-dd';//如果要 只选年则修改为'yyyy' 如果要 只选月则修改为 'yyyy-mm'
_this.className = 'datepicker-days';
_this.endDate = '2020-09-01';//默认结束时间
_this.mintDate = '2010-09-11';
_this.maxDate = '2020-09-11'
new DatePicker(_this.el,{
language: _this.language,
startTime: moment(_this.endDate).add('-7','day').format(_this.fs),
endTime:moment(_this.endDate).format(_this.fs),
fs:_this.fs,
dataFs:_this.dataFs,
startView:_this.startView,
maxViewMode:_this.maxViewMode,
minViewMode:_this.minViewMode,
minDate:moment(_this.mintDate).format(_this.fs),
maxDate:moment(_this.maxDate).format(_this.fs),
})