element icon indicating copy to clipboard operation
element copied to clipboard

[Feature Request] The choice of cut-off time based on the starting time

Open Denny-coder opened this issue 9 years ago • 9 comments

Existing Component

Yes

Component Name

el-date-picker

Description

The choice of cut-off time based on the starting time

Denny-coder avatar Sep 05 '17 02:09 Denny-coder

What is cut-off time?

Leopoldthecoder avatar Sep 05 '17 03:09 Leopoldthecoder

@Leopoldthecoder Deadline

pickerOptions0: {
      disabledDate(time) {
        return time.getTime() < Date.now() - 8.64e7;
      }
    },

Denny-coder avatar Sep 05 '17 04:09 Denny-coder

I'd like to change ‘Date.now() ’ I set @Leopoldthecoder

Denny-coder avatar Sep 05 '17 04:09 Denny-coder

You are free to change Date.now() to whatever variable you want.

Leopoldthecoder avatar Sep 05 '17 05:09 Leopoldthecoder

@Leopoldthecoder This value is uncertain and is entered by the user.I don't know how to get this value.

Denny-coder avatar Sep 05 '17 05:09 Denny-coder

<el-date-picker format="yyyy-MM-dd" v-model="Unselfsupportdata.shareStarTime" type="date" clearable style="width:135px">
                                            </el-date-picker>
                                            <el-date-picker format="yyyy-MM-dd" v-model="Unselfsupportdata.shareEndTime" :picker-options="pickerOptions0" type="date" clearable style="width:135px">
                                            </el-date-picker>
    pickerOptions0: {
            disabledDate(time) {
                console.log(this.$root)
                return time.getTime() < Date.now() - 8.64e7;
            }
        },

Denny-coder avatar Sep 05 '17 05:09 Denny-coder

Control the end time range depending on the start time. I probably didn't make it clear before.

Denny-coder avatar Sep 05 '17 05:09 Denny-coder

https://jsfiddle.net/z7pyykza/

Leopoldthecoder avatar Sep 05 '17 07:09 Leopoldthecoder

Succeed! Thanks very much

Denny-coder avatar Sep 05 '17 07:09 Denny-coder