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

feat(new-hope): edit calendar range logic and fix name #1084

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

iljs
Copy link
Contributor

@iljs iljs commented Mar 3, 2024

Calendar

  • добавлено возможность выбора одного дня для range

What/why changed

Возможность выбор 1 дня в типе range, убрал проверку на hoverDate со startDate. И изменил название функции, которая была написана неправильно

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
npm install @salutejs/[email protected]
# or 
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]
yarn add @salutejs/[email protected]

@Salute-Eva
Copy link
Contributor

Theme Builder app deployed!

http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1084/

@iljs iljs marked this pull request as ready for review March 4, 2024 05:19
@Yeti-or Yeti-or requested review from shuga2704 and TitanKuzmich and removed request for Yeti-or, neretin-trike and kayman233 March 4, 2024 08:06
@@ -8,7 +8,7 @@ import {
getOffsetDayInWeek,
getPrevDate,
IsCurrentDay,
isDayInRage,
isDayInRange,
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@@ -116,7 +116,7 @@ export const isDayInRage = (
}

const day = new Date(year, monthIndex, currentDay);
return startValue && startValue <= day && day <= endValue;
return startValue && startValue < day && day <= endValue;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return startValue && startValue < day && day <= endValue;
return startValue < day && day <= endValue;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

оно может быть undefined, поэтому лучше оставить проверку. TS ругается

Copy link
Contributor

Choose a reason for hiding this comment

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

Чуть выше в условии добавь плз проверку у startValue, также как это сделано с endValue.

@iljs iljs requested a review from shuga2704 March 4, 2024 13:17
@@ -116,7 +116,7 @@ export const isDayInRage = (
}

const day = new Date(year, monthIndex, currentDay);
return startValue && startValue <= day && day <= endValue;
return startValue && startValue < day && day <= endValue;
Copy link
Contributor

Choose a reason for hiding this comment

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

Чуть выше в условии добавь плз проверку у startValue, также как это сделано с endValue.

@iljs iljs force-pushed the feat-calendar-range-logic branch from a8c748c to 7bc0c67 Compare March 6, 2024 07:53
@iljs iljs requested a review from shuga2704 March 6, 2024 07:55
@Salute-Eva
Copy link
Contributor

Theme Builder app deployed!

http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1084/

feat(new-hope): calender utils startDay check
@Salute-Eva
Copy link
Contributor

Theme Builder app deployed!

http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1084/

@iljs iljs added this pull request to the merge queue Mar 6, 2024
Merged via the queue into dev with commit 02a0296 Mar 6, 2024
23 checks passed
@iljs iljs deleted the feat-calendar-range-logic branch March 6, 2024 10:14
This was referenced Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants