ILIAS  release_7 Revision v7.30-3-g800a261c036
DateTime.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2019 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
6
9
13interface DateTime extends Component, FormInput
14{
19
23 public function getFormat() : DateFormat;
24
28 public function withTimezone(string $tz) : DateTime;
29
34 public function getTimezone();
35
39 public function withMinValue(\DateTimeImmutable $datetime) : DateTime;
40
45 public function getMinValue();
46
50 public function withMaxValue(\DateTimeImmutable $datetime) : DateTime;
51
56 public function getMaxValue();
57
62 public function withUseTime(bool $with_time) : DateTime;
63
68 public function getUseTime() : bool;
69
74 public function withTimeOnly(bool $time_only) : DateTime;
75
80 public function getTimeOnly() : bool;
81}
An exception for terminatinating execution or to throw for unit testing.
A Date Format provides a format definition akin to PHP's date formatting options, but stores the sing...
Definition: DateFormat.php:11
A component is the most general form of an entity in the UI.
Definition: Component.php:14
This describes the datetime-field.
Definition: DateTime.php:14
getFormat()
Get the date-format of this input.
getTimeOnly()
Should the input be used to get a time only?
withTimezone(string $tz)
Get an input like this using the given timezone.
Definition: DateTime.php:114
getMaxValue()
Return the maximum date the input accepts.
withMaxValue(\DateTimeImmutable $datetime)
Limit accepted values to datetime before (and including) the given value.
getTimezone()
Get the timezone of this input.
withMinValue(\DateTimeImmutable $datetime)
Limit accepted values to datetime past (and including) the given $datetime.
withUseTime(bool $with_time)
Input both date and time.
withFormat(DateFormat $format)
Get an input like this using the given format.
getUseTime()
Should the input be used to get both date and time?
withTimeOnly(bool $time_only)
Use this Input for a time-value rather than a date.
getMinValue()
Return the lowest value the input accepts.
This describes inputs that can be used in forms.
Definition: FormInput.php:16
$format
Definition: metadata.php:218