แก้ไขการแสดงเวลา (support)
This commit is contained in:
parent
fc369de729
commit
e910d252aa
5 changed files with 260 additions and 225 deletions
|
|
@ -2,10 +2,12 @@
|
|||
import { ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useSupportStore } from "@/modules/00_support/store/Main";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import ChatMessage from "@/modules/00_support/components/ChatMessage.vue";
|
||||
|
||||
const store = useSupportStore();
|
||||
const content = ref<string>("");
|
||||
const { date2Thai } = useCounterMixin();
|
||||
const { scrollContainer } = storeToRefs(store);
|
||||
|
||||
function getOnlineStatus(option: "icon" | "status") {
|
||||
|
|
@ -13,6 +15,11 @@ function getOnlineStatus(option: "icon" | "status") {
|
|||
if (option === "icon") return isAdmin ? "green" : "grey";
|
||||
if (option === "status") return isAdmin ? "ออนไลน์" : "ออฟไลน์";
|
||||
}
|
||||
|
||||
const thaiOptions: Intl.DateTimeFormatOptions = {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -57,7 +64,21 @@ function getOnlineStatus(option: "icon" | "status") {
|
|||
name="mdi-information-outline"
|
||||
size="24px"
|
||||
color="grey"
|
||||
/>
|
||||
>
|
||||
<q-tooltip class="column">
|
||||
<span>{{ store.currentTitle }}</span>
|
||||
<span>
|
||||
{{ date2Thai(store.currentIssueDate) }}
|
||||
{{
|
||||
new Date(store.currentIssueDate).toLocaleTimeString(
|
||||
"th-TH",
|
||||
thaiOptions
|
||||
)
|
||||
}}
|
||||
น. <q-space />
|
||||
</span>
|
||||
</q-tooltip>
|
||||
</q-icon>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue