Skip to content

Commit

Permalink
add user timeformat for drafttable
Browse files Browse the repository at this point in the history
  • Loading branch information
fhelfer committed Jun 10, 2024
1 parent eabbc62 commit 3dbbff6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/ILIAS/Forum/classes/Drafts/ForumDraftsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
use ilObjUser;
use ilLanguage;
use ilObjForum;
use DateTimeZone;
use ilObjForumGUI;
use ilCtrlInterface;
use ilForumPostDraft;
use ILIAS\Data\Order;
use ILIAS\Data\Range;
use DateTimeImmutable;
use ilCalendarSettings;
use ILIAS\UI\URLBuilder;
use ILIAS\UI\Factory as UIFactory;
use ILIAS\Data\Factory as DataFactory;
Expand Down Expand Up @@ -178,13 +178,19 @@ private function limitRecords(array $records, Range $range): array
*/
private function getColumns(): array
{
if ((int) $this->user->getTimeFormat() === ilCalendarSettings::TIME_FORMAT_12) {
$format = $this->data_factory->dateFormat()->withTime12($this->user->getDateFormat());
} else {
$format = $this->data_factory->dateFormat()->withTime24($this->user->getDateFormat());
}

return [
'draft' => $this->ui_factory->table()->column()->link($this->lng->txt('drafts'))->withIsSortable(
false
)->withIsSortable(false),
'edited_on' => $this->ui_factory->table()->column()->date(
$this->lng->txt('edited_on'),
$this->data_factory->dateFormat()->germanLong()
$format
)->withIsSortable(false)
];
}
Expand Down

0 comments on commit 3dbbff6

Please sign in to comment.