Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问大神,是否可以在当前月份跨月选择?Choose Date over month #34

Open
dowinweb opened this issue Sep 14, 2017 · 7 comments

Comments

@dowinweb
Copy link

目前日期控件使用完美,但产品方面提出,在当前月可以选择临近月份的时间,而不是只能选择当前月,不知是否有属性可以做到?

if i was in September, i cannot pick the date of August, only if i change the month to August.So my question is can i pick date over the month, not disable the other month's date

@dowinweb
Copy link
Author

在不切换月份的情况下,跨月选择,是有点吹毛求疵了 — —

@jinzhe
Copy link
Owner

jinzhe commented Sep 15, 2017

这个目前没法实现,有空我实现一下。

@dowinweb
Copy link
Author

好的。多谢大神

@LindafairyWang
Copy link

可不可以加上月份选择的下拉框呢?

@damaohub
Copy link

damaohub commented Jan 3, 2018

可以像酒店预订移动端那样,一下子显示好几个月份,不要箭头按钮来切换月份,直接下滑显示,这个可以参考一下。

@xcqweb
Copy link

xcqweb commented Jun 26, 2018

calendar.vue 页面 第 453行,573行,593行 将{day: d,disabled: true} 改为 {day: d,disabled: false} 解除跨月选择禁用
然后再第699行select 法中 添加如下代码即可:

    select(k1, k2, e) {
        if (e != undefined) e.stopPropagation()
        let l =this.days[k1][k2].day //第一次选中
		let s = l; //保存第一次选中
        if ( l>=22 && l<=31 &&  k1 === 0){ //第一行
        	this.month=this.month-1
        }
        
        if ( l<=7 &&  k1 >= 4 ){ //第二行
        	this.month=this.month+1
        }
        
        if ( l>=22 &&  k1 >= 4 && s<=7){
        	this.month=this.month+1
        }
        
        if ( l<=7 &&  k1 === 0 && s>=28){
        	this.month=this.month-1
        }
        
        //跨年选取头部
        if(this.month===-1 && k1===0 && l>=22){
        	this.year = this.year-1
        	this.month = 11
        }
        //跨年选取尾部
         if(this.month===12 && k1>=4 && l<=7){
        	this.year = this.year+1
        	this.month = 0
        }

@huoguozhang
Copy link

同问

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants