Skip to content

Commit

Permalink
feat: useCalendar
Browse files Browse the repository at this point in the history
  • Loading branch information
nemo-shen committed Jan 14, 2024
1 parent 06a9617 commit f1fc6bb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/core/useCalendar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const getDays = (year: number, month: number) => {
export const useCalendar = (options: UseCalendarOptions = {}) => {
const {
initialDate = new Date(),
locale = 'en-US',
locale = Intl.DateTimeFormat().resolvedOptions().locale,
firstDayOfWeek = 0,
} = options

Expand Down
6 changes: 4 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<script setup lang="ts">
// import UseEllipsis from './demo/UseEllipsis.vue'
// import UseLoading from './demo/UseLoading.vue'
import UseProgress from './demo/UseProgress.vue'
// import UseProgress from './demo/UseProgress.vue'
import UseCalendar from './demo/UseCalendar.vue'
</script>

<template>
<!-- <UseEllipsis /> -->
<!-- <UseLoading /> -->
<UseProgress />
<!-- <UseProgress /> -->
<UseCalendar />
</template>
6 changes: 4 additions & 2 deletions src/demo/UseCalendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import { ref, h, VNode } from 'vue'
import { useCalendar } from '@noi/core'
useCalendar()
const { currentMonthDays } = useCalendar()
</script>

<template></template>
<template>
{{ currentMonthDays }}
</template>

0 comments on commit f1fc6bb

Please sign in to comment.