use of org.olat.modules.reminder.model.SendTime in project openolat by klemens.
the class CourseReminderEditController method getSendTimeDescription.
protected String getSendTimeDescription() {
String interval = reminderModule.getInterval();
String desc = translate("interval." + interval);
String time;
SendTime parsedTime = SendTime.parse(reminderModule.getDefaultSendTime());
if (parsedTime.isValid()) {
int hour = parsedTime.getHour();
int minute = parsedTime.getMinute();
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, hour);
cal.set(Calendar.MINUTE, minute);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
time = Formatter.getInstance(getLocale()).formatTimeShort(cal.getTime());
} else {
time = "ERROR";
}
String descText = translate("send.time.description", new String[] { desc, time });
String infoText = "<br /><em class='text-muted'>" + translate("send.time.info") + "</em>";
return descText + infoText;
}
Aggregations