ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilADTDatePresentationBridge.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 protected function isValidADT(ilADT $a_adt): bool
24 {
25 return ($a_adt instanceof ilADTDate);
26 }
27
28 public function getHTML(): string
29 {
30 if (!$this->getADT()->isNull()) {
31 // :TODO: relative dates?
32
33 return $this->decorate(ilDatePresentation::formatDate($this->getADT()->getDate()));
34 }
35 return '';
36 }
37
38 public function getSortable()
39 {
40 if (!$this->getADT()->isNull()) {
41 return (int) $this->getADT()->getDate()->get(IL_CAL_UNIX);
42 }
43 return 0;
44 }
45}
const IL_CAL_UNIX
getSortable()
Get sortable value presentation.
ADT presentation bridge base class.
ADT base class.
Definition: class.ilADT.php:26
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)