- Heavy rework on search request handling of entities
This commit is contained in:
1 parent
a9b9c2cce9
commit
11e436236c
8 files changed
+290
-167
No files matched your search
@@ -28,6 +28,13 @@ class Datetime extends \DateTime implements EntityObjectInterface {
|
||||
return $obj;
|
||||
}
|
||||
|
||||
public function setTime($hour, $minute, $second = 0, $microsecond = 0) : \DateTimeInterface
|
||||
{
|
||||
$fromParent = parent::setTime($hour, $minute, $second, $microsecond);
|
||||
|
||||
return new static($fromParent);
|
||||
}
|
||||
|
||||
public function save()
|
||||
{
|
||||
return $this->__toString();
|
||||
@@ -45,7 +52,7 @@ class Datetime extends \DateTime implements EntityObjectInterface {
|
||||
|
||||
public function formatLocaleIntl(int $dateFormatter = \IntlDateFormatter::LONG, int $timeFormatter = \IntlDateFormatter::NONE) : string
|
||||
{
|
||||
$formatter = new \IntlDateFormatter(\Locale::getDefault(), $dateFormatter, $timeFormatter, \Locale::getRegion());
|
||||
$formatter = new \IntlDateFormatter(\Locale::getDefault(), $dateFormatter, $timeFormatter);
|
||||
|
||||
return $formatter->format($this->getTimestamp());
|
||||
}
|
||||
@@ -54,4 +61,5 @@ class Datetime extends \DateTime implements EntityObjectInterface {
|
||||
{
|
||||
return (int) ( (int) ($dateTime ?: new DateTime())->format('Ymd') - (int) $this->format('Ymd') ) / 10000;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user