Home  >  Q&A  >  body text

javascript - The DateTimePicker of element ui can only limit the time to the date, not the specific time?

As the title says,

I have restricted the selection to a time beyond the current time. There is no problem with date restrictions, but I cannot restrict it to specific hours, minutes and seconds, so I can select the future. time.

code show as below:

<template>
    <el-date-picker
      v-model="endDate"
      type="datetime"
      :clearable="false"
      :picker-options="endPickerOptions"
      placeholder="选择结束时间">
    </el-date-picker>
</template>
endPickerOptions: {
   disabledDate(time) {
       let timeSpace = time.getTime() > Date.now());
            return timeSpace;
        }
    }

Have you ever experienced this pitfall, please give me some guidance?

仅有的幸福仅有的幸福2686 days ago1679

reply all(1)I'll reply

  • 欧阳克

    欧阳克2017-06-12 09:31:23

    I also encountered this problem, how did you solve it

    reply
    0
  • Cancelreply