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

Multiple selected date ranges #268

Open
mlundela opened this issue Jun 23, 2024 · 0 comments
Open

Multiple selected date ranges #268

mlundela opened this issue Jun 23, 2024 · 0 comments

Comments

@mlundela
Copy link

If more than one date range is specified for selected.dates, then they are displayed as one range. The overlapping day should be possible to style differently.

Screenshot 2024-06-23 at 12 20 25
const calendar = new VanillaCalendar('#read-only-calendar', {
  type: 'multiple',
  settings: {
    selection: {
      day: 'multiple-ranged',
    },
    selected: {
      dates: [
        '2024-06-01:2024-06-08',
        '2024-06-08:2024-06-15',
      ],
    },
    range: {
      disableAllDays: true,
    },
  }
});

If ranges do not overlap, then intermediate start and end dates are not styled correctly:
Screenshot 2024-06-23 at 12 20 08

const calendar = new VanillaCalendar('#read-only-calendar', {
  type: 'multiple',
  settings: {
    selection: {
      day: 'multiple-ranged',
    },
    selected: {
      dates: [
        '2024-06-01:2024-06-06',
        '2024-06-08:2024-06-14',
      ],
    },
    range: {
      disableAllDays: true,
    },
  }
});

My style override:

#read-only-calendar .vanilla-calendar-day__btn_selected {
  background-color: #f2295b;
}
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

No branches or pull requests

1 participant