Hello, Does anyone know if it's possible to automatically display todays date (and beyond) without adding a date column within HubDB?
I've created a very simple table within HubDB consisting of 2 columns - 'days of the week' and 'opening times'. I now want to add in the relevant date underneath each day without having to manually update hubdb each day. Is this possible?
//get today's date in unix timestamp in seconds
{% set today = (local_dt|unixtimestamp)//1000 %}
//one day in unix timestamp is 86400s long
{% set day = 86400 %}
//get tomorrow's/yesterday's date by adding or subtracting one day
{% set tomorrow = today + day %}
{% set yesterday = today - day %}
//get any number of days before or after with multiplication: e.g.
{% set dayafterTomorrow = today + (2 * day) %}
//re-convert unix timestamp back to a date
{{ (dayafterTomorrow * 1000)|datetimeformat('%B %e, %Y') }}
Edit: Nevermind, @stefen's solutions is waaay better haha. I didn't know about the plus_time filter