Skip to content

Commit

Permalink
fix: Update course dates prefix on course cards (#380)
Browse files Browse the repository at this point in the history
Co-authored-by: omer.habib <[email protected]>
  • Loading branch information
dixidroid and omerhabib26 authored Oct 8, 2024
1 parent 16a3b17 commit a8b7395
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 30 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/openedx/core/utils/TimeUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ object TimeUtils {
DateUtils.SECOND_IN_MILLIS,
DateUtils.FORMAT_ABBREV_RELATIVE
).toString()
resourceManager.getString(R.string.core_label_expired, timeSpan)
resourceManager.getString(R.string.core_label_access_expired, timeSpan)
}
} else {
formattedDate = if (dayDifferenceInMillis > SEVEN_DAYS_IN_MILLIS) {
resourceManager.getString(
R.string.core_label_expires_on,
R.string.core_label_expires,
dateToCourseDate(resourceManager, expiry)
)
} else {
Expand Down
11 changes: 5 additions & 6 deletions core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@
<string name="core_cancel">Cancel</string>
<string name="core_search">Search</string>
<string name="core_select_value">Select value</string>
<string name="core_label_starting">Starting %1$s</string>
<string name="core_label_ended">Ended %1$s</string>
<string name="core_label_starting">Starts %1$s</string>
<string name="core_label_ended">Ended on %1$s</string>
<string name="core_label_ends">Ends %1$s</string>
<string name="core_label_expires">Course access expires %1$s</string>
<string name="core_label_expires_on">Course access expires on %1$s</string>
<string name="core_label_expired">Course access expired %1$s</string>
<string name="core_label_expired_on">Course access expired on %1$s</string>
<string name="core_label_expires">Access expires %1$s</string>
<string name="core_label_access_expired">Access expired %1$s</string>
<string name="core_label_expired_on">Expired on %1$s</string>
<string name="core_password">Password</string>
<string name="core_assessment_soon">Soon</string>
<string name="core_offline">Offline</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,17 +454,14 @@ fun CourseItem(
overflow = TextOverflow.Ellipsis,
minLines = 1,
maxLines = 2,
text = stringResource(
org.openedx.dashboard.R.string.dashboard_course_date,
TimeUtils.getCourseFormattedDate(
LocalContext.current,
Date(),
course.auditAccessExpires,
course.course.start,
course.course.end,
course.course.startType,
course.course.startDisplay
)
text = TimeUtils.getCourseFormattedDate(
LocalContext.current,
Date(),
course.auditAccessExpires,
course.course.start,
course.course.end,
course.course.startType,
course.course.startDisplay
)
)
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,17 +708,14 @@ private fun PrimaryCourseTitle(
modifier = Modifier.fillMaxWidth(),
style = MaterialTheme.appTypography.labelMedium,
color = MaterialTheme.appColors.textFieldHint,
text = stringResource(
R.string.dashboard_course_date,
TimeUtils.getCourseFormattedDate(
LocalContext.current,
Date(),
primaryCourse.auditAccessExpires,
primaryCourse.course.start,
primaryCourse.course.end,
primaryCourse.course.startType,
primaryCourse.course.startDisplay
)
text = TimeUtils.getCourseFormattedDate(
LocalContext.current,
Date(),
primaryCourse.auditAccessExpires,
primaryCourse.course.start,
primaryCourse.course.end,
primaryCourse.course.startType,
primaryCourse.course.startDisplay
)
)
}
Expand Down

0 comments on commit a8b7395

Please sign in to comment.