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

The Datepicker calendar container is empty, no dates are displayed #187

Open
1 of 8 tasks
jas1337 opened this issue Oct 16, 2020 · 0 comments
Open
1 of 8 tasks

The Datepicker calendar container is empty, no dates are displayed #187

jas1337 opened this issue Oct 16, 2020 · 0 comments
Assignees
Labels

Comments

@jas1337
Copy link

jas1337 commented Oct 16, 2020

Hello, at first I have to say that we have been using your datepicker for a while and we appreciate the tool very much.

Description

Recently we found one special case where no dates are displayed in the datepicker container.
Having min/max date set in datepicker element where max is one day after min, date range is equal exactly 864e5 ms.

blank_calendar_code

In this case code this.value = toFormattedDateString(new Date(newValue)); is never reached.
Additionally if datepicker value is not valid value (for example it is null) then this.value is set to be today's date by default.

blank_calendar_code_setter

In result we can have this.value from outside min-max range. Then, inside getMultiCalendars helper function we have incorrect value of selectedDate and if (lastDayOfMonthTime < minTime || +firstDayOfMonth > maxTime) { condition is true, because of that no dates are displayed.

blank_calendar_code_multi_calendars

Expected outcome

Dates should be displayed in calendar container, honoring min-max range, date from min-max range should be focused.

Actual outcome

Calendar container is empty.
blank_calendar

Steps to reproduce

  1. Have datepicker where this.value is null, min and max are dates one after another from month other than current month
    (example value: null, today: 2020-10-16, min: 2020-09-02, max: 20202-09-03)

Browsers Affected

  • Chrome/ Opera
  • Firefox
  • Safari 10+
  • Safari 9
  • Safari 8
  • Safari 7
  • Edge 12+
  • IE 11

Summary

Suggested solution would be to change > to >= in if (getDateRange(minTime, maxTime) > 864e5) {check.

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

No branches or pull requests

2 participants