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

minDate and maxDate ignored with custom days #206

Open
yemartin opened this issue Mar 30, 2019 · 0 comments
Open

minDate and maxDate ignored with custom days #206

yemartin opened this issue Mar 30, 2019 · 0 comments

Comments

@yemartin
Copy link

Bug description

When using minDate or maxDate with custom days HTML, these limits are ignored when the day number is wrapped: a day rendered simply with

{{day.number}}

will be properly non-clickable when outside the minDate..maxDate range. But a day rendered with

<span>{{day.number}}</span>

will be selectable.

How to reproduce

{{#power-calendar
  selected=selected
  onSelect=(action (mut selected) value="date")
  as |calendar|}}
  {{calendar.nav}}
  {{#calendar.days minDate="2100-01-01" as |day|}}
    {{#with (format-date day.date 'd') as |weekday|}}
      {{#if (or (eq weekday "6") (eq weekday "0"))}}
        <span style="color: red;">{{day.number}}</span>
      {{else}}
        {{day.number}}
      {{/if}}
    {{/with}}
  {{/calendar.days}}
{{/power-calendar}}

Expected behavior

No days are selectable

Current behavior

Saturdays and Sundays are selectable.

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