Make it easier to display Dates and Times in site visitor's timezone
Currently Liquid can be used to display the UTC times from the database in a particular timezone:
{{this['Date Field'] | strftime: "%A %d %B at %I:%M %p %z", "Australia/Darwin"}}
But if you want to work out the visitor's timezone, it's necessary to implement a JS solution.
Graham Boyd has requested we build a feature which uses best practice JS but is quick to implement and re-usable.
Log in to comment and vote
Comments3
Apr 6, 2022
Jon Macmorland
Jan 12, 2022
Could this also allow for the switch between GMT & BST
Matt Jones
May 27, 2020
We're still deciding the best solution for this one.
To help us work out what's most useful, I'd just like to poll the voters on this feature- how would you prefer to specify the format for the date/time?
If there was a Liquid tag like:
{% include "local_date", date: this['Date of Sale'], format: "" %}
And you wanted to output 2020/05
Would you prefer to specify format with:
In all other Liquid contexts, you'd use the Liquid syntax, however since this Liquid parameter is destined to be run on a JavaScript variable, it might make more sense to input a JavaScript function to handle format.