You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
646 B
18 lines
646 B
import { computed, ref } from 'vue'
|
|
import { useStore } from '@/store/root'
|
|
|
|
export const useDay = () => {
|
|
const days = {
|
|
zh: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
|
|
en: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
|
tw: ['星期日', '星期壹', '星期二', '星期三', '星期四', '星期五', '星期六']
|
|
} as const
|
|
|
|
const date = ref(new Date())
|
|
const store = useStore()
|
|
const language = computed(() => store.language)
|
|
|
|
const whichWeek = computed(() => days[language.value][date.value.getDay()])
|
|
|
|
return { date, whichWeek }
|
|
}
|
|
|