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(VDatePicker): show-adjacent-months prop #12603

Merged
merged 2 commits into from
Nov 17, 2020

Conversation

jacekkarczmarczyk
Copy link
Member

@jacekkarczmarczyk jacekkarczmarczyk commented Nov 12, 2020

Description

Adds possibility to display days from prev/next monhts

Motivation and Context

fixes #12237

How Has This Been Tested?

playground

Markup:

<template>
  <v-container>
    <v-date-picker
      v-model="dates"
      :picker-date.sync="pickerDate"
      multiple
      show-current="2021-01-02"
    />
    <v-date-picker
      v-model="dates"
      show-adjacent-months
      :picker-date.sync="pickerDate"
      multiple
      show-current="2021-01-02"
    />
  </v-container>
</template>

<script>
  export default {
    data: () => ({ dates: ['2020-11-29', '2021-01-01'], pickerDate: '2020-12' }),
  }
</script>

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Improvement/refactoring (non-breaking change that doesn't add any features but makes things better)

Checklist:

  • The PR title is no longer than 64 characters.
  • The PR is submitted to the correct branch (master for bug fixes and documentation updates, dev for new features and backwards compatible changes and next for non-backwards compatible changes).
  • My code follows the code style of this project.
  • I've added relevant changes to the documentation (applies to new features and breaking changes in core library)

@jacekkarczmarczyk jacekkarczmarczyk added T: feature A new feature C: VDatePicker VDatePicker labels Nov 12, 2020
@jacekkarczmarczyk jacekkarczmarczyk added this to the v2.4.0 milestone Nov 12, 2020
@jacekkarczmarczyk jacekkarczmarczyk self-assigned this Nov 12, 2020
@jacekkarczmarczyk jacekkarczmarczyk changed the title feat(VDatePicker): **show-sibling-month** prop feat(VDatePicker): **show-sibling-months** prop Nov 12, 2020
nekosaur
nekosaur previously approved these changes Nov 12, 2020
Copy link
Member

@nekosaur nekosaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The only thing I could see is that the text/background contrast ratio for the disabled selected dates is pretty bad, but I guess that's a separate issue.

@jacekkarczmarczyk
Copy link
Member Author

Yeah, i'll try to fix in a separate PR

@KaelWD
Copy link
Member

KaelWD commented Nov 13, 2020

MD2 is kinda weird about this, the mobile picker doesn't show them:
image
The desktop picker does, but only the next month?
image

attrs: {
type: 'button',
},
domProps: {
disabled: this.disabled || !isAllowed,
disabled: this.disabled || !isAllowed || isOtherMonth,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk if disabled is right, the native ones are greyed out but still clickable: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date

@@ -121,6 +121,7 @@ export default mixins(
type: String,
default: '$vuetify.datePicker.itemsSelected',
},
showSiblingMonths: Boolean,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showAdjacentMonths? "sibling" implies possibly not directly next to.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just have it be default behaviour.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as for hold-on-hover for snackbar - do we need a prop to turn this behaviour off?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so.

@jacekkarczmarczyk
Copy link
Member Author

jacekkarczmarczyk commented Nov 16, 2020

Let's keep the default behaviour same as in2.3, I've renamed prop to show-adjacent-months

@jacekkarczmarczyk jacekkarczmarczyk changed the title feat(VDatePicker): **show-sibling-months** prop feat(VDatePicker): **show-adjacent-months** prop Nov 16, 2020
@KaelWD KaelWD changed the title feat(VDatePicker): **show-adjacent-months** prop feat(VDatePicker): show-adjacent-months prop Nov 17, 2020
@KaelWD KaelWD merged commit 8f1cf64 into dev Nov 17, 2020
@KaelWD KaelWD deleted the feat/#12237-date-picker-show-siblings branch November 17, 2020 13:12
@kurtthehurt
Copy link

Is it possible to enable the days reflected by shownAdjacentMonths?

@arcofine
Copy link

arcofine commented Apr 8, 2021

Can we add a prop to allow the shownAdjacentsMonths clickable if isAllowed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VDatePicker VDatePicker T: feature A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] v-date-picker: Possibility to show dates for previous and next month
5 participants