How to display dateTime relative to the user location?
Question
I am searching how to display the dateTime related to the user timezone using TWIG. I really want to understand how it works. Thank you.
Solution
There is no easy solution to get the user location in twig templates. I would :
- Try to get the user's timezone with Javascript
- Store this value in a session
- Then catch it with twig fron the
{{ app.session }}
object
Good luck ;)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow