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

[KOA-4846] Fixed white spaces selection in calendar component #2296

Merged
merged 9 commits into from
Dec 2, 2021
Merged

Conversation

anambl
Copy link
Contributor

@anambl anambl commented Nov 24, 2021

@github-actions
Copy link

github-actions bot commented Nov 25, 2021

Warnings
⚠️

Package source files (e.g. packages/package-name/src/Component.js) were updated, but snapshots weren't. Have you checked that the tests still pass?

Browser support

If this is a visual change, make sure you've tested it in multiple browsers,
particularly IE11.

Generated by 🚫 dangerJS against 0669639

@github-actions
Copy link

Visual regression tests passed 😎. Bear in mind that they only run in Chromium on static components – they aren't perfect.

@github-actions
Copy link

Visit https://backpack.github.io/storybook-prs/2296 to see this build running in a browser.

@github-actions
Copy link

Visual regression tests passed 😎. Bear in mind that they only run in Chromium on static components – they aren't perfect.

@github-actions
Copy link

Visit https://backpack.github.io/storybook-prs/2296 to see this build running in a browser.

@github-actions
Copy link

Visual regression tests passed 😎. Bear in mind that they only run in Chromium on static components – they aren't perfect.

@github-actions
Copy link

Visit https://backpack.github.io/storybook-prs/2296 to see this build running in a browser.

@anambl anambl changed the title fixed white spaces selection in calendar component [KOA-4846] Fixed white spaces selection in calendar component Nov 29, 2021
@anambl anambl marked this pull request as ready for review November 29, 2021 17:34
Copy link
Member

@olliecurtis olliecurtis left a comment

Choose a reason for hiding this comment

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

Just a couple of minior checks we should just verify to avoid unexpected crashes going on during the calendar operation

ignoreOutsideDate,
) {
const { startDate, endDate } = selectionConfiguration;
const sameStartDay = isSameDay(date, startDate);
Copy link
Member

Choose a reason for hiding this comment

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

We might want to check if startDate and endDate are available before calling these functions as it can sometimes throw errors that they are not available when calling the isSameDay functions - can we check it just to make sure?

I know this was something that came up during the original build of the code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point! I'll check this!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems like it should be alright as the function returns false if one or both dates are null 🤔

ignoreOutsideDate &&
rangeDates &&
isSameMonth(startDate, endDate) &&
isWithinRange(date, { start: startDate, end: endDate }) &&
Copy link
Member

Choose a reason for hiding this comment

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

Same query as above here

!isSameMonth(startDate, endDate) &&
!isSameMonth(month, date) &&
((isSameWeek(date, endDate, { weekStartsOn }) &&
isAfter(date, startDate)) ||
Copy link
Member

Choose a reason for hiding this comment

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

Same here

@olliecurtis
Copy link
Member

Also sorry I didn't mean to use request changes but comment instead 😂

Copy link
Member

@olliecurtis olliecurtis left a comment

Choose a reason for hiding this comment

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

This is amazing!

@anambl anambl merged commit 527bd72 into main Dec 2, 2021
@anambl anambl deleted the KOA-4846 branch December 2, 2021 10:36
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.

2 participants