How to display dateTime relative to the user location?
Pergunta
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.
Solução
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 ;)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow