Skip to content

fix some hardcoded dates #2208

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

Merged
merged 1 commit into from
Apr 15, 2025
Merged
Changes from all commits
Commits
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
18 changes: 9 additions & 9 deletions frontends/api/src/mitxonline/hooks/enrollment/data.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// FAKE DATA while API / auth work is in development
import { CourseRunEnrollment } from "../../generated/v0"

const soon = (days: number) => {
const future = (days: number) => {
return new Date(new Date().setDate(new Date().getDate() + days)).toISOString()
}

Expand Down Expand Up @@ -396,16 +396,16 @@ const courses = {
upgradeable_course_not_started: {
run: {
title: "Upgradeable Course, Not Yet Started",
start_date: soon(1),
end_date: "2040-12-20T15:00:00Z",
start_date: future(1),
upgrade_deadline: future(5),
end_date: future(10000),
enrollment_start: "2024-03-07T23:59:00Z",
enrollment_end: "2035-10-25T23:59:00Z",
expiration_date: null,
courseware_url:
"https://courses-qa.mitxonline.mit.edu/courses/course-v1:MITxT+14.73x+3T2023/course",
courseware_id: "course-v1:MITxT+14.73x+3T2023",
certificate_available_date: "2024-01-03T00:00:00Z",
upgrade_deadline: "2025-04-10T15:00:00Z",
is_upgradable: true,
is_enrollable: false,
is_archived: false,
Expand Down Expand Up @@ -503,16 +503,16 @@ const courses = {
run: {
title:
"Upgradeable Course, Not Yet Started, And This Course Also Has A Really Long Name That Goes Across Multiple Lines",
start_date: soon(5),
end_date: "2040-12-20T15:00:00Z",
start_date: future(5),
upgrade_deadline: future(15),
end_date: future(10000),
enrollment_start: "2024-03-07T23:59:00Z",
enrollment_end: "2035-10-25T23:59:00Z",
expiration_date: null,
courseware_url:
"https://courses-qa.mitxonline.mit.edu/courses/course-v1:MITxT+14.73x+3T2023/course",
courseware_id: "course-v1:MITxT+14.73x+3T2023",
certificate_available_date: "2024-01-03T00:00:00Z",
upgrade_deadline: "2025-04-10T15:00:00Z",
is_upgradable: true,
is_enrollable: false,
is_archived: false,
Expand Down Expand Up @@ -610,7 +610,7 @@ const courses = {
not_upgradeable_not_started: {
run: {
title: "Not Upgradeable, Not Started",
start_date: soon(10),
start_date: future(10),
end_date: "2040-12-20T15:00:00Z",
enrollment_start: "2024-03-07T23:59:00Z",
enrollment_end: "2035-10-25T23:59:00Z",
Expand Down Expand Up @@ -717,7 +717,7 @@ const courses = {
"https://courses-qa.mitxonline.mit.edu/courses/course-v1:MITxT+14.73x+3T2023/course",
courseware_id: "course-v1:MITxT+14.73x+3T2023",
certificate_available_date: "2024-01-03T00:00:00Z",
upgrade_deadline: "2025-04-10T15:00:00Z",
upgrade_deadline: future(8),
is_upgradable: true,
is_enrollable: false,
is_archived: false,
Expand Down
Loading