Available configuration options:
- string storage_type: Defines the storage format of the date. The default
is 'ISO', see below for details.
Available storage formats:
- ISO: YYYY-MM-DD HH:MM:SS
- ISO_DATE: YYYY-MM-DD
- ISO_EXTENDED: YYYY-MM-DDTHH:MM:SS(Z|[+-]HH:MM)
- ISO_EXTENDED_MICROTIME: YYYY-MM-DDTHH:MM:SS.S(Z|[+-]HH:MM)
- UNIXTIME: Unix Timestamps (seconds since epoch)
Methods
_on_configuring ($config)
Initialize the value with an empty DateTime object.
convert_from_csv ($source)
CSV conversion is mapped to regular type conversion.
convert_from_storage (mixed $source)
This function uses the DateTime constructor to handle the conversion.
It should be able to deal with all three storage variants transparently.
Parameters
$source
mixed
The storage data structure.
convert_to_csv ()
CSV conversion is mapped to regular type conversion.
convert_to_storage ()
Converts DateTime object to storage representation.
Returns
string
The string representation of the date according to the
storage_type.
is_empty ()
Tries to detect whether the date value entered is empty in terms of the Midgard
core.
For this, all values are compared to zero, if all tests succeed, the date
is considered empty.
Returns
boolean
Indicating Emptyness state.
Properties
string $later_than
Possible date field that must be earlier than this date field
mixed $max_date
Maximum date which the $value should not exceed, can be passed
in schema
mixed $min_date
Minimum date which the $value should not exceed, can be passed
in schema
string $storage_type
The storage type to use, see the class introduction for details.
\DateTime $value
The current date encapsulated by this type.