vuetifyjs / vuetifyjs/vuetify

[Feature Request] VDatePicker: Distinguish out-of-range dates versus allowed dates

Open
#21,285 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C: VDatePicker T: feature
Dominant language
TypeScript
Stars
41k
Forks
7.1k
Avg merge
1d 21h
Merged PRs (30d)
11

Description

Problem to solve

When using the min and max props with allowed-dates, any date that isn't selectable, whether because it falls outside the range or because allowedDates(date) returns false, is rendered with the same "disabled" style. This makes it impossible to differentiate visually:

  • Out-of-range (< min or > max)
  • In-range but not allowed (within min/max, but filtered out by allowed-dates)

You can observe the allowed-dates example in the VDatePicker Vuetify documentation.

Proposed solution

Have v-date-picker apply two separate CSS classes (and document them) so consumers can target each case:

  1. Dates outside min/max
  • Class: v-date-picker-date--out-of-range
  1. Dates inside the range but disallowed by allowed-dates
  • Class: v-date-picker-date--not-allowed
    Optionally, expose corresponding named slots or props, but at a minimum, distinct classes will let us write custom styles:
.v-date-picker-date--out-of-range {
  opacity: 0.4;
}

.v-date-picker-date--not-allowed {
  text-decoration: line-through;
  color: rgba(255, 0, 0, 0.7);
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the VDatePicker implementation and the allowed-dates documentation example. Trace how min/max and allowed-dates currently mark dates, then add and document distinct classes for out-of-range and in-range disallowed dates; done means consumers can style the two cases separately.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.