openeuropa / oe_whitelabel

European Union Public License 1.2
2 stars 4 forks source link

_oe_whitelabel_starter_event_preprocess_date disregards site timezone #234

Closed drishu closed 2 months ago

drishu commented 11 months ago

$dates->get('start_date') and $dates->get('end_date') have timezone set to UTC, but the sites have Europe/Brussles (as per php timezone set on server) when installed. The core formatter handles this by fetching the timezone, I think we should do the same, something like \Drupal::config('system.date')->get('timezone.default') and also account for users timezone (will be null if not allowed or not set so we can check for that). Steps to reproduce:

The issue becomes bigger if we would display the hour (ex requirement for teaser on one of the subsites)