refactor: migrate frontend datetimepicker

This commit is contained in:
2026-07-20 21:59:57 +08:00
parent 8e6ce7f6c4
commit c105d878fe
2 changed files with 724 additions and 3 deletions
+21 -3
View File
@@ -1,8 +1,26 @@
<script setup lang="ts"></script>
<script setup lang="ts">
import { ref } from 'vue';
import DateTimePicker, { TabType } from '@/components/DateTimePicker.vue';
// NOTE: This is a temporary test harness for the DateTimePicker.
// It will be removed when the Calendar page is migrated for real.
const picker = ref<InstanceType<typeof DateTimePicker>>();
const testDate = ref<Date>(new Date());
const openPicker = () => {
picker.value?.modal(testDate.value, TabType.Minute);
}
const onConfirm = (d: Date) => {
testDate.value = d;
}
</script>
<template>
<h1>Congratulations</h1>
<p>This is calendar.</p>
<div class="container" style="margin-top: 1.25rem;">
<a class="button is-primary" @click="openPicker">{{ testDate.toLocaleString() }}</a>
</div>
<DateTimePicker ref="picker" @confirm="onConfirm" />
</template>
<style scoped></style>