ILIAS  release_8 Revision v8.23
class.ilADTDateTimePresentationBridge.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 ilADTDateTime);
10  }
11 
12  public function getHTML(): string
13  {
14  if (!$this->getADT()->isNull()) {
15  // :TODO: relative dates?
16  return $this->decorate(ilDatePresentation::formatDate($this->getADT()->getDate()));
17  }
18  return '';
19  }
20 
21  public function getSortable()
22  {
23  if (!$this->getADT()->isNull()) {
24  return (int) $this->getADT()->getDate()->get(IL_CAL_UNIX);
25  }
26  return 0;
27  }
28 }
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...