I've got a Symfony API that is storing the users timezone as part of the login process. However, it seems certain timezones causes an error. Using 'America/Buenos_Aires'
as an example value being sent, the following code causes 500 error to be thrown.
$validator->validate($request->request, new Assert\Collection([
'username' => new AppAssert\Chain([
new Assert\Type('string'),
new Assert\NotBlank(),
]),
'password' => new AppAssert\Chain([
new Assert\Type('string'),
new Assert\NotBlank(),
]),
'timezone' => new AppAssert\Chain([
new Assert\Type('string'),
new Assert\NotIdenticalTo(''),
new Assert\Choice([
'choices' => \DateTimeZone::listIdentifiers(),
'strict' => true,
]),
]),
]));
Looking at this post https://bugs.php.net/bug.php?id=70816 it states to use DateTimeZone::ALL_WITH_BC
, which I've tried
'choices' => \DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC),
but still to no avial.
The client is using Moment JS which seems to sometimes return America/Argentina/Buenos_Aires
and sometimes America/Buenos_Aires
but
America/Argentina/Buenos_Aires
works fine.