-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[HOLD for payment 2023-12-07] [$500] IOU - Cannot proceed to next month and dates appear blank when last day of month is selected #31793
Comments
Job added to Upwork: https://www.upwork.com/jobs/~01cc0d157099a8bbaa |
Triggered auto assignment to @miljakljajic ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.What is the root cause of that problem?The issue is that in the App/src/components/NewDatePicker/CalendarPicker/index.js Lines 130 to 131 in d521dd6
Here, if the next month has <= days than the selected day number, we compare the start of the day with the end of the same day (end of next month):
What changes do you think we should make in order to solve the problem?We should simplify this logic to avoid unnecessary chained calculations and only check if the max allowed date is after the end of the current month. This would mean that there are available dates next month – at least the const hasAvailableDatesNextMonth = startOfDay(new Date(this.props.maxDate)) > endOfMonth(new Date(this.state.currentDateView));
const hasAvailableDatesPrevMonth = endOfDay(new Date(this.props.minDate)) < startOfMonth(new Date(this.state.currentDateView)); Also, we'll need to prevent the non-existing days from being falsely marked as "selected" when navigating, so we should also add a const isSelected = !!day && isSameDay(parseISO(this.props.value), new Date(currentYearView, currentMonthView, day)); App/src/components/NewDatePicker/CalendarPicker/index.js Lines 218 to 222 in d521dd6
Result:Screen.Recording.2023-11-23.at.22.34.49.movWhat alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Cannot proceed to next month and dates appear blank when the last day of the month is selected What is the root cause of that problem?Here will check for next month button should show or not, we are checking with the start time of the max date (last date of the current month) which cause the problem
What changes do you think we should make in order to solve the problem?Here we should use the end of the day time instead of start time of max date const hasAvailableDatesNextMonth = endOfDay(endOfMonth(new Date(this.props.maxDate))) > addMonths(new Date(this.state.currentDateView), 1); What alternative solutions did you explore? (Optional)NA |
@paultsimura Thanks for the proposal. Your RCA is correct and the solution looks good to me 👍. PS: When raising a PR please add test case in CalendarPickerTest.js to prevent this from happening again. 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @MonilBhavsar, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@rakshitjain13 Thanks for the proposal. Your RCA is correct. The suggested solution would work but it's not complete i.e. it does not fix the wrongly selected days ![]() |
Looks good. Agree we should simplify the logic |
📣 @s77rt 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @paultsimura 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
Thank you. The PR is ready for review: #32073 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.5-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-12-07. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
|
Both contracts paid and ended - thank you for your work! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.3.0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
Action Performed:
Expected Result:
In Step 6, user should be able to go to November.
In Step 8, no blank dates will be shown.
Actual Result:
In Step 6, user is unable to go to November.
In Step 8, blank dates are shown.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6288891_1700768927135.bandicam_2023-11-24_02-23-21-687.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: