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

[#12045] Instructor copying sessions: preserve time when auto-changing dates #12051

Merged
merged 3 commits into from
Mar 1, 2023
Merged

[#12045] Instructor copying sessions: preserve time when auto-changing dates #12051

merged 3 commits into from
Mar 1, 2023

Conversation

andremralves
Copy link
Contributor

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).

image

Copy link
Contributor

@zhaojj2209 zhaojj2209 left a 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.

@zhaojj2209 zhaojj2209 added the s.ToReview The PR is waiting for review(s) label Feb 5, 2023
@nusoss-bot
Copy link

Folks, This PR seems to be stalling (no activities for the past 7 days). 🐌 😢
Hope someone can get it to move forward again soon...

@zhaojj2209
Copy link
Contributor

Closing due to inactivity. Feel free to reopen this PR if you would like to continue working on it.

@zhaojj2209 zhaojj2209 closed this Feb 19, 2023
@andremralves
Copy link
Contributor Author

andremralves commented Feb 21, 2023

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?

@zhaojj2209 zhaojj2209 reopened this Feb 22, 2023
@zhaojj2209 zhaojj2209 requested a review from domlimm March 1, 2023 07:34
Copy link
Contributor

@domlimm domlimm left a 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! 👍🏻

Copy link
Contributor

@zhaojj2209 zhaojj2209 left a 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!

@zhaojj2209 zhaojj2209 added s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging and removed s.ToReview The PR is waiting for review(s) labels Mar 1, 2023
@zhaojj2209 zhaojj2209 merged commit a1fa4c5 into TEAMMATES:master Mar 1, 2023
@samuelfangjw samuelfangjw added this to the V8.24.0 milestone Mar 9, 2023
@samuelfangjw samuelfangjw added the c.Feature User-facing feature; can be new feature or enhancement to existing feature label Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c.Feature User-facing feature; can be new feature or enhancement to existing feature s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instructor copying sessions: preserve time when auto-changing dates
5 participants