add a i18n api field for the users "now" datetime (#2007)
This commit is contained in:
@@ -81,6 +81,7 @@ final class ConfigurationController extends BaseApiController
|
||||
->setDuration($this->formats->getDurationFormat($locale))
|
||||
->setTime($this->formats->getTimeFormat($locale))
|
||||
->setIs24hours($this->formats->isTwentyFourHours($locale))
|
||||
->setNow($this->getDateTimeFactory()->createDateTime())
|
||||
;
|
||||
|
||||
$view = new View($model, 200);
|
||||
|
||||
@@ -88,6 +88,23 @@ final class I18nConfig
|
||||
* @Serializer\Type(name="boolean")
|
||||
*/
|
||||
private $is24hours = true;
|
||||
/**
|
||||
* The current time of the user
|
||||
*
|
||||
* @var \DateTime
|
||||
*
|
||||
* @Serializer\Expose()
|
||||
* @Serializer\Groups({"Default"})
|
||||
* @Serializer\Type(name="DateTime")
|
||||
*/
|
||||
private $now;
|
||||
|
||||
public function setNow(\DateTime $now): I18nConfig
|
||||
{
|
||||
$this->now = $now;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setFormDateTime(string $formDateTime): I18nConfig
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user