Skip to content

Commit

Permalink
feat(calendar): weekDays
Browse files Browse the repository at this point in the history
  • Loading branch information
nemo-shen committed Jan 28, 2024
1 parent e397271 commit e0a9cf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/useCalendar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const useCalendar = (options: UseCalendarOptions = {}) => {
let daysOfWeek: string | any[]
switch (locale) {
case 'zh-CN':
daysOfWeek = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
daysOfWeek = ['', '', '', '', '', '', '']
break
case 'en-US':
daysOfWeek = ['Sun', 'Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 'Sat']
Expand Down
9 changes: 7 additions & 2 deletions src/demo/UseCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { ref, h, VNode } from 'vue'
import { useCalendar } from '@noi/core'
const {
weekDays,
currentMonthDays,
goToToday,
goToNextMonth,
goToPreviousMonth,
goToNextYear,
goToPreviousYear,
} = useCalendar()
} = useCalendar({
locale: 'zh-CN',
})
</script>

<template>
Expand All @@ -22,6 +25,8 @@ const {
<button @click="goToToday">goToToday</button>
需要生成一个当前日历需要知道哪些信息 1. 当前的月份有多少天 2.
每天是一个对象,应该会配有不同的内容 3. 周 4. 当前的年月 5.

<br />
{{ weekDays }}
<br />
{{ currentMonthDays }}
</template>

0 comments on commit e0a9cf1

Please sign in to comment.