Skip to content

Support disable dates between the validRange for "multiple" or "range" modes #103

@mogarick

Description

@mogarick

First than all, congratulations for the component! It rocks!.

Now going to the point.

In a use case for an event that occurs along 3 to 4 days when a day is full and not accepting new registrations, such day should be disabled to pick. The current implementation only supports to provide a range and to disable weekDays but it doesn't support to disable specific date between the such range.

So an additional and optional param would be needed in validRange named disabledDates where we can add dates to disable between the valid range . A validation would be needed to ensure the disabled dates are in range or just ignore them if they aren’t.

Digging a little bit into de code of Month.tsx the next modif could be made inside code block starting at L240:

if (inRange) {
	disabled = false;
	let inDisabledDates = validRangeDisabledDates.some(disabledDate => disabledDate === day);
	if(inDisabledDates) {
		disabled = true
	}
}

A conversion for disabledDates may be needed to ensure a day vs day comparison and the result assigned to validRangeDisabledDates array where we can use it to make the comparison and determine if the day is disabled or not.

I'm not sure if more modifs are needed since a didn't dig deeper into the code.

Could it be possible such change?

Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions