Skip to content

Commit a738e7f

Browse files
committed
feat: display the certificate available date if available in progress tab
1 parent b6c29df commit a738e7f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/course-home/progress-tab/certificate-status/CertificateStatus.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ const CertificateStatus = () => {
9191
const dashboardLink = <DashboardLink />;
9292
const idVerificationSupportLink = <IdVerificationSupportLink />;
9393
const profileLink = <ProfileLink />;
94-
9594
// Some learners have a valid ("downloadable") certificate without being in a passing
9695
// state (e.g. learners who have been added to a course's allowlist), so we need to
9796
// skip grade validation for these learners
9897
const certIsDownloadable = certStatus === 'downloadable';
98+
9999
if (mode === COURSE_EXIT_MODES.disabled) {
100100
certEventName = 'certificate_status_disabled';
101101
} else if (mode === COURSE_EXIT_MODES.nonPassing && !certIsDownloadable) {
@@ -187,7 +187,8 @@ const CertificateStatus = () => {
187187
// regardless of passing or nonpassing status
188188
if (!canViewCertificate) {
189189
certCase = 'notAvailable';
190-
endDate = intl.formatDate(end, {
190+
// use the certificate_available_date if it is available, otherwise use the end date of the course
191+
endDate = intl.formatDate((certificateAvailableDate || end), {
191192
year: 'numeric',
192193
month: 'long',
193194
day: 'numeric',
@@ -214,6 +215,7 @@ const CertificateStatus = () => {
214215
});
215216
// eslint-disable-next-line react-hooks/exhaustive-deps
216217
}, []);
218+
217219
if (!certCase) {
218220
return null;
219221
}

src/courseware/course/course-exit/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const CELEBRATION_STATUSES = [
1717
'audit_passing',
1818
'downloadable',
1919
'earned_but_not_available',
20+
'not_earned_but_available_date',
2021
'honor_passing',
2122
'requesting',
2223
'unverified',

0 commit comments

Comments
 (0)