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

X2-4379: Add option to not select future dates in pre-calculated date ranges #211

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ranjantanya
Copy link
Contributor

No description provided.

Comment on lines +91 to +99
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);
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor Author

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.

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