ILIAS
release_8 Revision v8.24
◀ ilDoc Overview
TimeSpan.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\UI\Implementation\Component\Table\Column
;
22
23
use
ILIAS\UI\Component\Table\Column
as
C
;
24
use
ILIAS\Data\DateFormat\DateFormat
;
25
26
class
TimeSpan
extends
Column
implements
C\TimeSpan
27
{
28
protected
DateFormat
$format
;
29
30
public
function
__construct
(
31
\
ilLanguage
$lng
,
32
string
$title
,
33
DateFormat
$format
34
)
35
{
36
parent::__construct
(
$lng
,
$title
);
37
$this->
format
=
$format
;
38
}
39
40
public
function
getFormat
():
DateFormat
41
{
42
return
$this->format
;
43
}
44
45
public
function
format
($value): string
46
{
47
$this->checkArgListElements(
'value'
, $value, [\DateTimeImmutable::class]);
48
return
49
$value[0]->format($this->
getFormat
()->toString())
50
.
' - '
.
51
$value[1]->format($this->
getFormat
()->toString());
52
}
53
57
public
function
getOrderingLabels
(): array
58
{
59
return
[
60
$this->asc_label ?? $this->
getTitle
() . self::SEPERATOR . $this->
lng
->txt(
'order_option_chronological_ascending'
),
61
$this->desc_label ?? $this->
getTitle
() . self::SEPERATOR . $this->
lng
->txt(
'order_option_chronological_descending'
)
62
];
63
}
64
}
ILIAS\Data\DateFormat\DateFormat
A Date Format provides a format definition akin to PHP's date formatting options, but stores the sing...
Definition:
DateFormat.php:27
ILIAS\UI\Component\TimeSpan
ILIAS\UI\Implementation\Component\Table\Column\Column
Definition:
Column.php:28
ILIAS\UI\Implementation\Component\Table\Column\Column\$lng
ilLanguage $lng
Definition:
Column.php:39
ILIAS\UI\Implementation\Component\Table\Column\Column\$title
string $title
Definition:
Column.php:38
ILIAS\UI\Implementation\Component\Table\Column\Column\getTitle
getTitle()
Definition:
Column.php:49
ILIAS\UI\Implementation\Component\Table\Column\TimeSpan
Definition:
TimeSpan.php:27
ILIAS\UI\Implementation\Component\Table\Column\TimeSpan\$format
DateFormat $format
Definition:
TimeSpan.php:28
ILIAS\UI\Implementation\Component\Table\Column\TimeSpan\format
format($value)
Definition:
TimeSpan.php:45
ILIAS\UI\Implementation\Component\Table\Column\TimeSpan\__construct
__construct(\ilLanguage $lng, string $title, DateFormat $format)
Definition:
TimeSpan.php:30
ILIAS\UI\Implementation\Component\Table\Column\TimeSpan\getOrderingLabels
getOrderingLabels()
Definition:
TimeSpan.php:57
ILIAS\UI\Implementation\Component\Table\Column\TimeSpan\getFormat
getFormat()
Definition:
TimeSpan.php:40
ilLanguage
language handling
Definition:
class.ilLanguage.php:44
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Definition:
PluginProviderHelper.php:37
ILIAS\Repository\lng
lng()
Definition:
trait.GlobalDICDomainServices.php:56
ILIAS\UI\Component\Table\Column
Definition:
Boolean.php:21
ILIAS\UI\Component
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS\UI\Implementation\Component\Table\Column
Definition:
Boolean.php:21
src
UI
Implementation
Component
Table
Column
TimeSpan.php
Generated on Sun Nov 2 2025 22:02:01 for ILIAS by
1.9.4 (using
Doxyfile
)