-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix(calendar): fix minDate/maxDate #1543
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: db83588 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Собрана новая демка. |
|
||
// отсекаем лишние месяцы если задана минимальная дата | ||
if (minDate) { | ||
generatedMonthsWithWeeks = generatedMonthsWithWeeks.filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему решил это делать отдельными проходами, а не в основном цикле?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Решил что так будет более последовательно. В основном цикле мы можем отфильтровать только prevYearMonths и nextYearMonths (currYearMonths придется фильтровать вне цикла). Причем каждый из трёх отрезков придется проверять как на minDate так и на maxDate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А их много там получается? Кажется это можно заменить на один reduce
Исправлено количество отображаемых месяцев при использовании minDate/maxDate пропсов
https://jira.moscow.alfaintra.net/browse/DS-7885