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

Datepicker: disable specific days #440 #537

Conversation

silviokennecke
Copy link

@silviokennecke silviokennecke commented Nov 17, 2022

Short summary

Currently you cannot disable specific days in the date picker. This PR allows you to disable specific dates or weekdays.

What does this PR exactly to?

It adds a new configuration disabledDays. The value must be of type array contains weekdays (integer) and/or specific dates (string). The isDateDisabled method will then return true for all dates that match one of the values in the given array.

Example code

<!-- date-picker-example.blade.php -->
<div>
    <form wire:submit.prevent="save">
        <!-- disable weekends and 2022-11-23 -->
        <x-datetime-picker
            :min="now()"
            :max="now()->addDays(14)"
            :disabledDays="[0, 6, '2022-11-23']"
        />
    </form>
</div>

Associated issues

Documentation

The documentation has been updated. See https://github.com/wireui/docs/pull/39

silviokennecke added a commit to silviokennecke/wireui-docs that referenced this pull request Nov 17, 2022
silviokennecke added a commit to silviokennecke/wireui-docs that referenced this pull request Nov 17, 2022
@silviokennecke silviokennecke changed the title disable specific days #440 Datepicker: disable specific days #440 Nov 17, 2022
@zxtanzxzx
Copy link

@PH7-Jack May I ask for a status on this issue/pr. Is this being worked in V2 of wireui? I would like to contribute if possible.

@joaopalopes24
Copy link
Member

This was implemented in v2 stable.

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

Successfully merging this pull request may close these issues.

4 participants