Skip to content

Commit

Permalink
CSCEXAM-1203 Fix date formatting (#1110)
Browse files Browse the repository at this point in the history
- Email about being added as parcipant to a BYOD
  • Loading branch information
lupari authored Jun 7, 2024
1 parent ee5749d commit b570eea
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions app/impl/EmailComposerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -836,29 +836,20 @@ public void composePrivateExamParticipantNotification(User student, User fromUse
String.format("%s (%s)", exam.getName(), exam.getCourse().getCode().split("_")[0])
);
String teacherName = messaging.get(lang, "email.template.participant.notification.teacher", getTeachers(exam));
DateTimeFormatter dtf = DateTimeFormat.forPattern("dd.MM.yyyy HH:mm");
String events = exam
.getExaminationEventConfigurations()
.stream()
.map(c -> c.getExaminationEvent().getStart())
.map(c -> new DateTime(c.getExaminationEvent().getStart(), timeZone))
.sorted()
.map(dtf::print)
.map(DTF::print)
.collect(Collectors.joining(", "));
String examPeriod = isAquarium
? messaging.get(
lang,
"email.template.participant.notification.exam.period",
String.format(
"%s - %s",
DF.print(new DateTime(exam.getPeriodStart())),
DF.print(new DateTime(exam.getPeriodEnd()))
)
String.format("%s - %s", DF.print(exam.getPeriodStart()), DF.print(exam.getPeriodEnd()))
)
: messaging.get(
lang,
"email.template.participant.notification.exam.event",
String.format("%s (%s)", events, timeZone)
);
: messaging.get(lang, "email.template.participant.notification.exam.event", events);
String examDuration = messaging.get(
lang,
"email.template.participant.notification.exam.duration",
Expand Down

0 comments on commit b570eea

Please sign in to comment.