-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(Calendar): add month/year picker modes and view switching #5981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
onmax
wants to merge
7
commits into
nuxt:v4
Choose a base branch
from
onmax:feat/calendar-month-year-picker
base: v4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
13ee385
feat(calendar): add month and year picker modes
onmax 0f082e9
fix(calendar): update formatter locale in place
onmax 1c7f1ee
fix(Calendar): preserve picker root props and view state
onmax 6deceb8
fix(Calendar): use namespaced month and year pickers
onmax ece110e
refactor(Calendar): simplify PR code
onmax 1822c67
fix(calendar): restore picker test contract after rebase
onmax fe8227a
Merge branch 'v4' into feat/calendar-month-year-picker
onmax File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs/app/components/content/examples/calendar/CalendarMonthPickerExample.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <script setup lang="ts"> | ||
| import type { CalendarDate } from '@internationalized/date' | ||
| import { DateFormatter, getLocalTimeZone } from '@internationalized/date' | ||
|
|
||
| const modelValue = shallowRef<CalendarDate>() | ||
| const formatter = new DateFormatter('en-US', { | ||
| month: 'long', | ||
| year: 'numeric' | ||
| }) | ||
|
|
||
| const label = computed(() => { | ||
| if (!modelValue.value) { | ||
| return 'Select month' | ||
| } | ||
|
|
||
| return formatter.format(modelValue.value.toDate(getLocalTimeZone())) | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <UPopover> | ||
| <UButton variant="outline" color="neutral" trailing-icon="i-lucide-calendar"> | ||
| {{ label }} | ||
| </UButton> | ||
|
|
||
| <template #content> | ||
| <UCalendar v-model="modelValue" type="month" /> | ||
| </template> | ||
| </UPopover> | ||
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.