@@ -11,6 +11,7 @@
:placeholder="options.placeholder ?? '请选择'"
auto-apply
text-input
+ :disabled-dates="options.disabledDates || false"
:show-now-button="options.showToday"
now-button-label="今天"
:enable-time-picker="options.enableTimePicker ?? false"
@@ -6,6 +6,7 @@
placeholder="面试时间 *"
class="mb-4"
model-type="timestamp"
+ :disabled-dates="disabledDates"
:text-input="{ format: 'MM.dd.yyyy HH:mm' }" />
</template>
</CtForm>
@@ -26,6 +27,11 @@ const props = defineProps({
}
})
+// 过去的日期不可选
+const disabledDates = (date) => {
+ return date.getTime() < new Date().getTime()
+}
+
const CtFormRef = ref()
const formItems = ref({
options: [