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

fix(calendar): fix minDate/maxDate #1543

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

fulcanellee
Copy link
Collaborator

Исправлено количество отображаемых месяцев при использовании minDate/maxDate пропсов
https://jira.moscow.alfaintra.net/browse/DS-7885

Copy link

changeset-bot bot commented Jan 22, 2025

🦋 Changeset detected

Latest commit: db83588

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@alfalab/core-components-calendar Minor
@alfalab/core-components-calendar-input Patch
@alfalab/core-components-calendar-range Patch
@alfalab/core-components-calendar-with-skeleton Patch
@alfalab/core-components-date-range-input Patch
@alfalab/core-components-date-time-input Patch

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

@fulcanellee fulcanellee requested a review from Oladii January 22, 2025 08:36
@core-ds-bot
Copy link
Collaborator

Собрана новая демка.


// отсекаем лишние месяцы если задана минимальная дата
if (minDate) {
generatedMonthsWithWeeks = generatedMonthsWithWeeks.filter(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему решил это делать отдельными проходами, а не в основном цикле?

Copy link
Collaborator Author

@fulcanellee fulcanellee Jan 30, 2025

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А их много там получается? Кажется это можно заменить на один reduce

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

Successfully merging this pull request may close these issues.

4 participants