Skip to content
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

feat(calendar): prop to switch between dynamic/static number of weeks #19584

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

nekosaur
Copy link
Member

Description

looking at previous art, most "fullscreen" calendars seem to go with a varying week length of either 5 or 6 depending on how the days in the month are arranged. this includes arguably the two biggest examples (google, microsoft). but there are ones that use a static 6 weeks, pretty much always together with showing adjacent days.

date-pickers also vary, but ones based on material design like MUI do use static 6 weeks so that the dialog does not jump when switching months

with this change, date-picker uses static by default, calendar uses dynamic

Markup:

<template>
  <v-app>
    <v-container>
      <v-date-picker />

      <v-calendar
        v-model="date"
      ></v-calendar>

      <v-calendar
        v-model="date"
        weeks-in-month="static"
        show-adjacent-months
      ></v-calendar>
    </v-container>
  </v-app>
</template>

<script>
  import { ref } from 'vue'
  export default {
    name: 'Playground',
    setup () {
      const date = ref([new Date()])
      return {
        date,
      }
    },
  }
</script>

@nekosaur nekosaur requested review from johnleider and blalan05 April 10, 2024 15:33
@nekosaur nekosaur self-assigned this Apr 10, 2024
@nekosaur nekosaur force-pushed the feat/calendar-weeks-in-month branch from d911205 to 4c6ea34 Compare April 10, 2024 15:34
date-picker uses static by default, calendar uses dynamic
@johnleider johnleider force-pushed the feat/calendar-weeks-in-month branch from 4c6ea34 to 8494b7f Compare April 10, 2024 21:10
@johnleider johnleider changed the base branch from master to dev April 10, 2024 21:10
johnleider
johnleider previously approved these changes Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants