configure am/pm time-format as user preference (#2789)

This commit is contained in:
Kevin Papst
2021-11-14 18:18:26 +01:00
committed by GitHub
parent dce0578a2b
commit 8b0962e192
32 changed files with 216 additions and 260 deletions

View File

@@ -64,13 +64,12 @@ final class ConfigurationController extends BaseApiController
$model = new I18nConfig();
$model
->setFormDateTime($formats->getDateTimeTypeFormat($locale))
->setFormDate($formats->getDateTypeFormat($locale))
->setDateTime($formats->getDateTimeFormat($locale))
->setDate($formats->getDateFormat($locale))
->setDuration($formats->getDurationFormat($locale))
->setTime($formats->getTimeFormat($locale))
->setIs24hours($formats->isTwentyFourHours($locale))
->setIs24hours($user->is24Hour())
->setNow($this->getDateTimeFactory()->createDateTime())
;

View File

@@ -18,17 +18,6 @@ use JMS\Serializer\Annotation as Serializer;
*/
final class I18nConfig
{
/**
* Format used for 'begin' and 'end'
*
* @var string
*
* @Serializer\Expose()
* @Serializer\Groups({"Default"})
* @Serializer\Type(name="string")
* @phpstan-ignore-next-line
*/
private $formDateTime = '';
/**
* Format used for toolbar queries
*
@@ -114,13 +103,6 @@ final class I18nConfig
return $this;
}
public function setFormDateTime(string $formDateTime): I18nConfig
{
$this->formDateTime = $formDateTime;
return $this;
}
public function setFormDate(string $formDate): I18nConfig
{
$this->formDate = $formDate;