Skip to content

Conversation

J-Sek
Copy link
Contributor

@J-Sek J-Sek commented Jan 15, 2025

Description

  • multiple="week" let's user select week with single click
  • highlights row on hover and upon selection
  • dedicated header and title in picker header

Markup:

Playground 1
<template>
  <v-app>
    <v-container max-width="500">
      <v-text-field label="native week selector" type="week" />
      <v-date-input
        v-model="dates"
        color="primary"
        label="VDateInput"
        multiple="week"
        placeholder="mm/dd/yyyy - mm/dd/yyyy"
        persistent-placeholder
        show-week
      />

      <v-date-picker
        v-model="dates"
        color="primary"
        multiple="week"
        show-adjacent-months
        show-week
      />
      <v-btn @click="dates = []">Clear</v-btn>
      <pre>{{ dates }}</pre>
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'

  const dates = ref([])
</script>
Playground 2
<template>
  <v-app>

    <v-app-bar class="pr-10">
      <v-spacer />
      <v-switch v-model="showWeek" label="show week" hide-details />
    </v-app-bar>
    <v-main scrollable>

      <v-locale-provider locale="en">
        <v-container class="d-flex align-start ga-6 justify-center flex-wrap" width="1600">
          <v-date-picker
            v-model="value"
            :max="new Date()"
            :min="new Date(2000, 9, 15)"
            :show-week="showWeek"
            elevation="24"
            multiple="week"
          />
          <v-date-picker
            v-model="value"
            :max="new Date()"
            :min="new Date(2000, 9, 15)"
            :show-week="showWeek"
            elevation="24"
            multiple="week"
            no-month-picker
          />
          <v-date-picker
            v-model="value"
            :max="new Date()"
            :min="new Date(2000, 9, 15)"
            :show-week="showWeek"
            elevation="24"
            multiple="week"
          />
          <v-date-picker
            v-model="value"
            :max="new Date()"
            :min="new Date(2000, 9, 15)"
            :show-week="showWeek"
            color="primary"
            elevation="24"
            multiple="week"
          />
          <v-date-picker
            v-model="value"
            :max="new Date()"
            :min="new Date(2000, 9, 15)"
            :show-week="showWeek"
            :weekdays="[1,2,3,4,5]"
            class="weekdays-primary"
            elevation="24"
            multiple="week"
            weekday-format="short"
            hide-header
          />
          <v-date-picker
            v-model="value"
            :max="new Date()"
            :min="new Date(2000, 9, 15)"
            :show-week="showWeek"
            elevation="24"
            multiple="week"
            weeks-in-month="dynamic"
            hide-header
            hide-weekdays
            show-adjacent-months
          />
        </v-container>
      </v-locale-provider>
      <!-- verify with RTL: <v-locale-provider locale="ar"> ... </v-locale-provider> -->
    </v-main>
  </v-app>
</template>

<script setup>
  import { shallowRef } from 'vue'
  const value = shallowRef(null)
  const showWeek = shallowRef(false)
</script>

<style>
.weekdays-primary {
  padding-top: 12px;
  .v-date-picker-month__weekday {
    color: rgb(var(--v-theme-primary));
  }

  .v-date-picker-month__days {
    position: relative;

    &:before,
    &:after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      height: 1px;
      background-color: rgb(var(--v-theme-primary));
      top: 4px;
    }

    &:after {
      top: 36px;
    }
  }
}
</style>

@J-Sek J-Sek self-assigned this Jan 15, 2025
@J-Sek J-Sek force-pushed the feat/vdatepicker-range-week branch from afe5bc1 to 2ce8772 Compare January 15, 2025 13:08
@J-Sek J-Sek force-pushed the feat/vdatepicker-range-week branch from 2ce8772 to f8f95ab Compare June 12, 2025 15:56
@J-Sek J-Sek force-pushed the feat/vdatepicker-range-week branch from f8f95ab to 61a46e6 Compare June 27, 2025 08:11
@J-Sek
Copy link
Contributor Author

J-Sek commented Jun 27, 2025

I think at some point we will need to get rid of grid gap as it makes displaying range highlight very hard. I am compensating with CSS, but this cannot scale beyond week selection.

@J-Sek J-Sek force-pushed the feat/vdatepicker-range-week branch from 61a46e6 to ab1420d Compare July 9, 2025 12:59
@KaelWD KaelWD force-pushed the dev branch 2 times, most recently from 6331ca7 to 564ccc8 Compare September 10, 2025 13:29
@J-Sek J-Sek force-pushed the dev branch 3 times, most recently from a7fa817 to 2e2cddb Compare October 8, 2025 15:22
@J-Sek J-Sek added this to the v4.0.0 (Revisionist) milestone Oct 17, 2025
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.

1 participant