diff --git a/src/components/03_customer-management/HistoryEditComponent.vue b/src/components/03_customer-management/HistoryEditComponent.vue index e9e221e6..ae799e18 100644 --- a/src/components/03_customer-management/HistoryEditComponent.vue +++ b/src/components/03_customer-management/HistoryEditComponent.vue @@ -55,6 +55,7 @@ const columns: QTableColumn[] = [ const currentDate = ref(); const currentData = ref(); const currentIndex = ref(0); +const isHistoryData = ref(false); const formatList = ref([]); const fieldName = [ @@ -201,6 +202,19 @@ const fieldName = [ }, ]; +function nextDate(pre: boolean = false) { + const date = new Date(currentDate.value); + pre ? date.setDate(date.getDate() - 1) : date.setDate(date.getDate() + 1); + const dateKey = formatDate(date.toString()); + currentDate.value = dateKey; +} + +function formatDate(date: string) { + const updatedAt = new Date(date); + const dateKey = `${updatedAt.getFullYear()}-${updatedAt.getMonth() + 1}-${updatedAt.getDate()}`; + return dateKey; +} + function isValidDate(dateString: string): boolean { if (typeof dateString !== 'string' || dateString.length < 24) { return false; @@ -294,10 +308,12 @@ onMounted(async () => { }); watch( - () => currentIndex.value, + () => currentDate.value, (i) => { - currentDate.value = formatList.value[i].date; - currentData.value = formatList.value[i].data; + const dateKey = formatDate(i); + isHistoryData.value = formatList.value.some( + (item) => item.date === dateKey, + ); }, ); @@ -308,31 +324,49 @@ watch( class="row full-width justify-center q-py-sm header-border" style="background: hsla(var(--info-bg) / 0.1)" > -
+
- - {{ dateFormat(currentDate) }} - + + + + +
diff --git a/src/css/quasar.variables.scss b/src/css/quasar.variables.scss index 5c6e5c7a..575e921e 100644 --- a/src/css/quasar.variables.scss +++ b/src/css/quasar.variables.scss @@ -74,6 +74,10 @@ div.fullscreen.q-drawer__backdrop { font-family: 'Noto Sans Thai', sans-serif; } +.dp__overlay_cell.dp__overlay_cell_pad { + font-family: 'Noto Sans Thai', sans-serif; +} + .disabled, .disabled *, [disabled],