-
Notifications
You must be signed in to change notification settings - Fork 22
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
X2-4379: Add option to not select future dates in pre-calculated date ranges #211
base: master
Are you sure you want to change the base?
Conversation
const newRange = { ...range }; | ||
if ( | ||
!shouldSelectFutureDatesInRelativeRange && // don't select future dates, e.g. for cash flow report | ||
range.to.isAfter(dayjs().get("date")) | ||
) { | ||
newRange.to = dayjs().get("date"); | ||
} | ||
|
||
onChange(newRange, modifiers, null); |
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.
I think this will not work. Did you mean to use dayjs().toDate()
instead of dayjs().get("date")
?
dayjs().get("date")
just returns a number of the current day in month.
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.
Also, I feel like this logic belongs to x2-seller
and not ui-kit
. We can discuss when you are free
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.
Yeah needs to be changed, not sure how it was working when I checked.
No description provided.