-
Notifications
You must be signed in to change notification settings - Fork 20
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
Conversation
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1084/ |
Documentation preview deployed! website: http://plasma.sberdevices.ru/pr/pr-1084/ |
@@ -8,7 +8,7 @@ import { | |||
getOffsetDayInWeek, | |||
getPrevDate, | |||
IsCurrentDay, | |||
isDayInRage, | |||
isDayInRange, |
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.
👍
@@ -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; |
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.
return startValue && startValue < day && day <= endValue; | |
return startValue < day && day <= endValue; |
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.
оно может быть undefined, поэтому лучше оставить проверку. TS ругается
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.
Чуть выше в условии добавь плз проверку у startValue, также как это сделано с endValue.
@@ -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; |
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.
Чуть выше в условии добавь плз проверку у startValue, также как это сделано с endValue.
a8c748c
to
7bc0c67
Compare
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1084/ |
Documentation preview deployed! website: http://plasma.sberdevices.ru/pr/pr-1084/ |
feat(new-hope): calender utils startDay check
7bc0c67
to
789e771
Compare
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-1084/ |
Documentation preview deployed! website: http://plasma.sberdevices.ru/pr/pr-1084/ |
Calendar
range
What/why changed
Возможность выбор 1 дня в типе range, убрал проверку на hoverDate со startDate. И изменил название функции, которая была написана неправильно
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via: