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

Disable specific days of the week #12

Closed
cdmoro opened this issue Nov 19, 2017 · 6 comments
Closed

Disable specific days of the week #12

cdmoro opened this issue Nov 19, 2017 · 6 comments
Assignees

Comments

@cdmoro
Copy link

cdmoro commented Nov 19, 2017

Possibility to disable specific days of the week. Par exemple, disable choosing Sathurdays and Sundays

@nathanreyes
Copy link
Owner

Duplicate of #7

@nathanreyes nathanreyes marked this as a duplicate of #7 Nov 19, 2017
@cdmoro
Copy link
Author

cdmoro commented Nov 19, 2017

I think this issue and the #7 are slightly differents, the #7 it's about apply a style to specific days, this issue is about make certains days unselectable by the user. Par exemple, the datepicker of this site https://wffranco.github.io/vue-strap/#datepicker

@nathanreyes
Copy link
Owner

In 0.4.0, you can use date patterns with the disabled-dates prop. So, for your example, you can use the following notation:

<v-date-picker
  :disabled-dates='disabledDates'>
</v-date-picker>
export default {
  data() {
    return {
      disabledDates: { weekdays: [1, 7] },
    };
  }
}

For more information about date patters, you can reference the README for more info about date patterns, as the documentation has not yet been updated to explain them fully. Also, the website uses this very example for the date picker demo.

@vinkodlak
Copy link

Nathan, really great work, thank you!

Can we distinguish between disabled dates and, hm, 'unselectable' dates. For example, if sat and sun are unselectable, you could still pick friday until monday, but if some dates are disabled you could not select after those?

@nathanreyes
Copy link
Owner

Yes, what you describe is how it should work. I just forgot to fully test this in trying to finish up the last feature.

@jayheavner
Copy link

I know this is very old but has the unselectable vs disabled been resolved? I'm trying to do a work scheduler and Sat/Sun are unselectable but things can certainly span over weekends.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants