Class luya\web\jsonld\DateValue
| Inheritance | luya\web\jsonld\DateValue ยป luya\web\jsonld\BaseValue |
|---|---|
| Available since version | 1.0.3 |
| Source Code | https://github.com/luyadev/luya/blob/master/core/web/jsonld/DateValue.php |
A date value in ISO 8601 date format.
Auto convert timestamp values to iso 8601 date.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Provide date data. | luya\web\jsonld\DateValue |
| getValue() | Get the value to assign from BaseValue. | luya\web\jsonld\DateValue |
Method Details
Provide date data.
| public void __construct ( $date ) | ||
| $date | string|integer | |
public function __construct($date)
{
$this->_date = $date;
}
Get the value to assign from BaseValue.
| public void getValue ( ) |
public function getValue()
{
if (is_numeric($this->_date)) {
$this->_date = date("Y-m-d", $this->_date);
}
return $this->_date;
}