Skip to content

Commit 7ed922a

Browse files
fix some hardcoded dates (#2208)
1 parent ec555e8 commit 7ed922a

File tree

1 file changed

+9
-9
lines changed
  • frontends/api/src/mitxonline/hooks/enrollment

1 file changed

+9
-9
lines changed

frontends/api/src/mitxonline/hooks/enrollment/data.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// FAKE DATA while API / auth work is in development
22
import { CourseRunEnrollment } from "../../generated/v0"
33

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

@@ -396,16 +396,16 @@ const courses = {
396396
upgradeable_course_not_started: {
397397
run: {
398398
title: "Upgradeable Course, Not Yet Started",
399-
start_date: soon(1),
400-
end_date: "2040-12-20T15:00:00Z",
399+
start_date: future(1),
400+
upgrade_deadline: future(5),
401+
end_date: future(10000),
401402
enrollment_start: "2024-03-07T23:59:00Z",
402403
enrollment_end: "2035-10-25T23:59:00Z",
403404
expiration_date: null,
404405
courseware_url:
405406
"https://courses-qa.mitxonline.mit.edu/courses/course-v1:MITxT+14.73x+3T2023/course",
406407
courseware_id: "course-v1:MITxT+14.73x+3T2023",
407408
certificate_available_date: "2024-01-03T00:00:00Z",
408-
upgrade_deadline: "2025-04-10T15:00:00Z",
409409
is_upgradable: true,
410410
is_enrollable: false,
411411
is_archived: false,
@@ -503,16 +503,16 @@ const courses = {
503503
run: {
504504
title:
505505
"Upgradeable Course, Not Yet Started, And This Course Also Has A Really Long Name That Goes Across Multiple Lines",
506-
start_date: soon(5),
507-
end_date: "2040-12-20T15:00:00Z",
506+
start_date: future(5),
507+
upgrade_deadline: future(15),
508+
end_date: future(10000),
508509
enrollment_start: "2024-03-07T23:59:00Z",
509510
enrollment_end: "2035-10-25T23:59:00Z",
510511
expiration_date: null,
511512
courseware_url:
512513
"https://courses-qa.mitxonline.mit.edu/courses/course-v1:MITxT+14.73x+3T2023/course",
513514
courseware_id: "course-v1:MITxT+14.73x+3T2023",
514515
certificate_available_date: "2024-01-03T00:00:00Z",
515-
upgrade_deadline: "2025-04-10T15:00:00Z",
516516
is_upgradable: true,
517517
is_enrollable: false,
518518
is_archived: false,
@@ -610,7 +610,7 @@ const courses = {
610610
not_upgradeable_not_started: {
611611
run: {
612612
title: "Not Upgradeable, Not Started",
613-
start_date: soon(10),
613+
start_date: future(10),
614614
end_date: "2040-12-20T15:00:00Z",
615615
enrollment_start: "2024-03-07T23:59:00Z",
616616
enrollment_end: "2035-10-25T23:59:00Z",
@@ -717,7 +717,7 @@ const courses = {
717717
"https://courses-qa.mitxonline.mit.edu/courses/course-v1:MITxT+14.73x+3T2023/course",
718718
courseware_id: "course-v1:MITxT+14.73x+3T2023",
719719
certificate_available_date: "2024-01-03T00:00:00Z",
720-
upgrade_deadline: "2025-04-10T15:00:00Z",
720+
upgrade_deadline: future(8),
721721
is_upgradable: true,
722722
is_enrollable: false,
723723
is_archived: false,

0 commit comments

Comments
 (0)