Skip to content

Calendar flexibility in selecting specialDates/disabledDates #11653

Description

@hanastasov

Question

The DateRangeDescriptor class provides means to configure dates selection in following ways:

  1. BETWEEN two dates
  2. AFTER a date
  3. BEFORE a date
  4. SPECIFIC dates
  5. All WEEKENDS
  6. All WEEKDAYS

Why not being able to specify the following as well:

  1. All weekends BETWEEN two dates
  2. All weekdays BEETWEEN two dates

The above seems to require no API changes and only implementation changes to respect the range provided:

    this.calendar.disabledDates = [
      { type: DateRangeType.Weekends, dateRange: range },
    ];
    this.calendar.specialDates= [
      { type: DateRangeType.Weekdays, dateRange: range },
    ];
  1. All weekends/weekdays AFTER a date
  2. All weekends/weekdays BEFORE a date

Those two seem to require API changes, maybe passing a second type constraint:

    this.calendar.specialDates= [
      { type: DateRangeType.Weekdays, dateRange: singleDate, secondConstraint: DateRangeType.After },
    ];

but seems to bring complexity that is not worth to handle I think.

Activity

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions