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

[#12494] Allow instructors to use start/end dates up to 12 months in future #12498

Merged
merged 24 commits into from
Jul 12, 2023
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5a1e7d6
feat: add safety net for invalid dates
Zxun2 Jun 26, 2023
41b3717
feat: update start/end dates from 3 to 12 months
Zxun2 Jun 26, 2023
71c36f1
Merge branch 'master' into zongxun/use-start-dates-in-future
Zxun2 Jun 30, 2023
b914726
perf: reduce side effects
Zxun2 Jun 30, 2023
db8790f
Merge branch 'zongxun/use-start-dates-in-future' of https://github.co…
Zxun2 Jun 30, 2023
ddb339a
Merge branch 'master' into zongxun/use-start-dates-in-future
domlimm Jul 2, 2023
48f0f47
fix: update error message
Zxun2 Jul 3, 2023
9268bd3
feat: add safety net for time
Zxun2 Jul 3, 2023
857d7c7
Merge branch 'zongxun/use-start-dates-in-future' of https://github.co…
Zxun2 Jul 3, 2023
2e6e741
feat: testcase for `getInstantMonthsOffsetFromNow`
Zxun2 Jul 4, 2023
10f6459
fix: failing component tests
Zxun2 Jul 4, 2023
188f4bf
Merge branch 'master' into zongxun/use-start-dates-in-future
Zxun2 Jul 4, 2023
5deb933
Merge branch 'master' into zongxun/use-start-dates-in-future
Zxun2 Jul 6, 2023
9912e1e
refactor(sessions-edit-form): abstract model to base class
Zxun2 Jul 6, 2023
f8fda23
fix: linting
Zxun2 Jul 6, 2023
2a70f59
fix: inaccurate end time when start date > end date
Zxun2 Jul 7, 2023
6a246ac
misc: update javadocs
Zxun2 Jul 11, 2023
3bd19ee
misc: change twelve to 12
Zxun2 Jul 11, 2023
f55bcf7
fix: update missing attribute
Zxun2 Jul 11, 2023
105d262
fix: add missing edge case
Zxun2 Jul 11, 2023
2069940
Merge branch 'zongxun/use-start-dates-in-future' of https://github.co…
Zxun2 Jul 11, 2023
ab7e5af
fix: add missing edge case when startDate > endDate and hours are equal
Zxun2 Jul 12, 2023
2ab6738
Merge branch 'master' into zongxun/use-start-dates-in-future
Zxun2 Jul 12, 2023
15e44ea
Merge branch 'master' into zongxun/use-start-dates-in-future
weiquu Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: update start/end dates from 3 to 12 months
  • Loading branch information
Zxun2 committed Jun 26, 2023
commit 41b3717c84ce187e0f1a44ee3df056f72c253f64
Original file line number Diff line number Diff line change
Expand Up @@ -175,17 +175,17 @@ export class SessionEditFormComponent {
/**
* Gets the maximum date for a session to be opened.
*
* <p> The maximum session opening datetime is 90 days from now.
* <p> The maximum session opening datetime is 12 months from now.
*/
get maxDateForSubmissionStart(): DateFormat {
const ninetyDaysFromNow = moment().tz(this.model.timeZone).add(90, 'days');
return this.datetimeService.getDateInstance(ninetyDaysFromNow);
const twelveMonthsFromNow = moment().tz(this.model.timeZone).add(12, 'months');
return this.datetimeService.getDateInstance(twelveMonthsFromNow);
}

/**
* Gets the maximum time for a session to be opened.
*
* <p> The maximum session opening datetime is 90 days from now.
* <p> The maximum session opening time is 23:59h.
*/
get maxTimeForSubmissionStart(): TimeFormat {
return getLatestTimeFormat();
Expand Down Expand Up @@ -232,17 +232,17 @@ export class SessionEditFormComponent {
/**
* Gets the maximum date for a session to be closed.
*
* <p> The maximum session closing datetime is 180 days from now.
* <p> The maximum session closing datetime is 12 months from now.
*/
get maxDateForSubmissionEnd(): DateFormat {
const oneHundredAndEightyDaysFromNow = moment().tz(this.model.timeZone).add(180, 'days');
const oneHundredAndEightyDaysFromNow = moment().tz(this.model.timeZone).add(12, 'months');
Zxun2 marked this conversation as resolved.
Show resolved Hide resolved
return this.datetimeService.getDateInstance(oneHundredAndEightyDaysFromNow);
}

/**
* Gets the maximum time for a session to be closed.
*
* <p> The maximum session closing datetime is 180 days from now.
* <p> The maximum session closing time is 23:59H.
*/
get maxTimeForSubmissionEnd(): TimeFormat {
return getLatestTimeFormat();
Expand Down