-
Notifications
You must be signed in to change notification settings - Fork 3.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
[#12045] Instructor copying sessions: preserve time when auto-changing dates #12051
[#12045] Instructor copying sessions: preserve time when auto-changing dates #12051
Conversation
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.
InstructorHomePageE2ETest
is failing due to the changes made in this PR, do look into it.
Also, before opening a PR, we would appreciate if you could indicate interest in fixing the issue in the issue thread itself first, and check that there are no other people working to fix the issue.
Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢 |
Closing due to inactivity. Feel free to reopen this PR if you would like to continue working on it. |
Hi @zhaojj2209, I would like to reopen this PR but I think I don't have the right to reopen it. Could you reopen it for me, please? |
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.
LGTM! Thanks for solving this issue and catching the inconsistent rounding! 👍🏻
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.
LGTM, thanks for the fix!
Fixes #12045
Outline of Solution
When copying a feedback session, if the dates aren't in the allowed time period, the new date will use your local time to generate a valid date range. For the opening time, the new date is +2 days from now and for the closing time the new date is +7 days from now. I kept this logic and added an extra logic to set the time to the original one instead of your local time.
I also changed some variable names as the names were saying "roundedUp", but what is really happening is a round down with the "startOf" method of moment.js. So I changed the last part to "roundedDown".
I didn't changed the logic to keep the time for dates that surpasses the upper bound limit because that could lead to some corner case problems if the original time is bigger than the local time (the date would be bigger than the limit).