ILIAS  release_8 Revision v8.23
class.ilADTDatePresentationBridge.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 {
7  protected function isValidADT(ilADT $a_adt): bool
8  {
9  return ($a_adt instanceof ilADTDate);
10  }
11 
12  public function getHTML(): string
13  {
14  if (!$this->getADT()->isNull()) {
15  // :TODO: relative dates?
16 
17  return $this->decorate(ilDatePresentation::formatDate($this->getADT()->getDate()));
18  }
19  return '';
20  }
21 
22  public function getSortable()
23  {
24  if (!$this->getADT()->isNull()) {
25  return (int) $this->getADT()->getDate()->get(IL_CAL_UNIX);
26  }
27  return 0;
28  }
29 }
decorate($a_value)
Decorate value.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
ADT base class.
Definition: class.ilADT.php:11
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...