TimeZoneResolver
class TimeZoneResolver implements EventSubscriberInterface (View source)
Event handler that resolves time zone based on site and user configuration.
Sets the time zone using date_default_timezone_set().
Properties
| protected ConfigFactoryInterface | $configFactory | The config. |
Methods
__construct(AccountInterface $current_user, ConfigFactoryInterface $config_factory)
TimeZoneResolver constructor.
setDefaultTimeZone()
Sets the default time zone.
static
getSubscribedEvents()
{@inheritdoc}
string|null
getTimeZone()
Gets the time zone based on site and user configuration.
Details
__construct(AccountInterface $current_user, ConfigFactoryInterface $config_factory)
TimeZoneResolver constructor.
setDefaultTimeZone()
Sets the default time zone.
onConfigSave(ConfigCrudEvent $event)
Updates the default time zone when time zone config changes.
static
getSubscribedEvents()
{@inheritdoc}
protected string|null
getTimeZone()
Gets the time zone based on site and user configuration.