Skip to content
Snippets Groups Projects
Commit 3919ab80 authored by Moritz Strohm's avatar Moritz Strohm
Browse files

changed output format of SeminarCycleDate::toString, CourseDate::getFullName...

changed output format of SeminarCycleDate::toString, CourseDate::getFullName and CourseExDate::getFullName and made the output of CourseDateList::toHtml a list with invisible list items, fixes #4889

Closes #4889

Merge request studip/studip!3662
parent f73e2918
No related branches found
No related tags found
No related merge requests found
......@@ -331,7 +331,7 @@ class CourseDate extends SimpleORMap implements PrivacyObject, Event
$string = sprintf(
'%1$s, %2$s - %3$s',
$day_of_week,
date('d.m.Y H:i', $this->date),
date('d.m.y, H:i', $this->date),
$formatted_end
);
}
......
......@@ -135,17 +135,36 @@ class CourseExDate extends SimpleORMap implements PrivacyObject, Event
return '';
}
$latter_template = $format === 'verbose'
? _('%R Uhr')
: '%R';
if (($this->end_time - $this->date) / 60 / 60 > 23) {
return strftime('%a., %x' . ' (' . _('ganztägig') . ')' , $this->date) . " (" . _("fällt aus") . ")";
$date_string = studip_interpolate(
$format === 'verbose'
? _('%{weekday}, %{date}, %{start} - %{end} Uhr (ganztägig, fällt aus)')
: _('%{weekday}, %{date}, %{start} - %{end} (ganztägig, fällt aus)')
,
[
'weekday' => getWeekday(date('N', $this->date)),
'date' => date('d.m.y', $this->date),
'start' => date('H:i', $this->date),
'end' => date('H:i', $this->end_time),
]
);
return $date_string;
}
return strftime('%a., %x, %R', $this->date) . ' - '
. strftime($latter_template, $this->end_time)
. ' (' . _('fällt aus') . ')';
$date_string = studip_interpolate(
$format === 'verbose'
? _('%{weekday}, %{date}, %{start} - %{end} Uhr (fällt aus)')
: _('%{weekday}, %{date}, %{start} - %{end} (fällt aus)')
,
[
'weekday' => getWeekday(date('N', $this->date)),
'date' => date('d.m.y', $this->date),
'start' => date('H:i', $this->date),
'end' => date('H:i', $this->end_time),
]
);
return $date_string;
}
/**
......
......@@ -253,7 +253,7 @@ class SeminarCycleDate extends SimpleORMap
}
$first_date = $this->getFirstDate();
if ($first_date) {
$parameters['start_date'] = date('d.m.Y', $first_date->date);
$parameters['start_date'] = date('d.m.y', $first_date->date);
}
if ($room && $first_date) {
$text = _('%{weekday}, %{beginning} - %{end}, %{interval} (ab dem %{start_date} im Raum %{room_name})');
......
......@@ -10,7 +10,7 @@
*/
?>
<? if (!$collection->isEmpty()) : ?>
<ul>
<ul class="list-unstyled">
<? foreach ($collection->getRegularDates() as $regular_date) : ?>
<li><?= $regular_date->toString('long-start') ?></li>
<? endforeach ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment