@@ -31,9 +31,14 @@ const CoursesList = ({ partnerId, catalogId }: CoursesListProps) => {
3131 pageCount,
3232 isLoading,
3333 } = useCatalogCourses ( partnerId , catalogId , pageIndex + 1 , pageSize ) ;
34- const positions = Array . from ( { length : count + 1 || 0 } , ( _ , i ) => i ) ;
3534 const deleteCatalogCourse = useDeleteCatalogCourse ( ) ;
3635
36+ const positions = Array . from ( { length : count + 1 || 0 } , ( _ , i ) => i ) ;
37+ const formatDate = ( date : string | null ) => {
38+ if ( ! date ) return '' ;
39+ return intl . formatDate ( date ) ;
40+ } ;
41+
3742 const tableActions = [ {
3843 type : 'view' ,
3944 action : ( course ) => navigate ( paths . courseDetail . buildPath ( partnerId , catalogId , course . courseRun . id ) ) ,
@@ -116,10 +121,28 @@ const CoursesList = ({ partnerId, catalogId }: CoursesListProps) => {
116121 {
117122 Header : intl . formatMessage ( messages . headerCourseDates ) ,
118123 accessor : 'courseDates' ,
124+ // eslint-disable-next-line react/no-unstable-nested-components
125+ Cell : ( { row } : CoursesCell ) => {
126+ const { start, end } = row . original . courseRun ;
127+ return (
128+ < >
129+ { `${ formatDate ( start ) } - ${ formatDate ( end ) } ` }
130+ </ >
131+ )
132+ }
119133 } ,
120134 {
121135 Header : intl . formatMessage ( messages . headerEnrollmentDates ) ,
122136 accessor : 'enrollmentDates' ,
137+ // eslint-disable-next-line react/no-unstable-nested-components
138+ Cell : ( { row } : CoursesCell ) => {
139+ const { enrollmentStart, enrollmentEnd } = row . original . courseRun ;
140+ return (
141+ < >
142+ { `${ formatDate ( enrollmentStart ) } - ${ formatDate ( enrollmentEnd ) } ` }
143+ </ >
144+ )
145+ }
123146 } ,
124147 {
125148 Header : intl . formatMessage ( messages . headerEnrollment ) ,
@@ -132,6 +155,11 @@ const CoursesList = ({ partnerId, catalogId }: CoursesListProps) => {
132155 {
133156 Header : intl . formatMessage ( messages . headerCompletion ) ,
134157 accessor : 'completionRate' ,
158+ Cell : ( { row } : CoursesCell ) => (
159+ < >
160+ { row . original . completionRate } %
161+ </ >
162+ ) ,
135163 } ,
136164 ] }
137165 >
0 commit comments