保誠-保戶業務員媒合平台
Tomas
2022-04-27 85c39644533f93559ccf51cc4c8dfa7388d36cd4
PAMapp/components/Ui/UiDatePicker.vue
@@ -31,6 +31,9 @@
    @Prop({default: false})
    isFutureDateDisabled!: boolean;
    @Prop()
    disabledBeforeSpecificDate?: string;
    @Emit('changeDate')
    changeDate() {
        return this.dateValue;
@@ -47,6 +50,16 @@
    get pickerOptions() {
        const date = new Date();
        const currentDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
        if (!!this.disabledBeforeSpecificDate) {
          const compareDate = new Date(this.disabledBeforeSpecificDate);
          return {
              disabledDate(time: Date) {
                  const pickedDate = `${time.getFullYear()}/${time.getMonth() + 1}/${time.getDate()}`;
                  return new Date(pickedDate).getTime() < compareDate.getTime();
              }
          }
        }
        if (this.isPastDateDisabled) {
            return {
@@ -68,4 +81,4 @@
    }
}
</script>
</script>