Skip to content

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