Blog, Website & Page Publishing

ben-duchy
Contributeur de premier rang

Display HubDB Date Column

SOLVE

Hello could someone give the below code the once over please?

I've used the date filter a million times before, but for some reason it's not working this time!

{% set date_test = hubdb_table_rows(1234567) %}
{% set close_date = unixtimestamp(row.close_date) %}

{% for row in date_test %}
  {{ close_date | datetimeformat('%e/%m/%Y') }} <br>
{% endfor %}

 

The above only displays todays date on every row, even though the dates are different within HubDB. I'm puzzled!

0 Upvotes
1 Accepted solution
ben-duchy
Solution
Contributeur de premier rang

Display HubDB Date Column

SOLVE

Ignore me, I needed to put the ' set close_date' within the loop - school boy error! 😣

 

{% set date_test = hubdb_table_rows(1234567) %}

{% for row in date_test %}
  {% set close_date = unixtimestamp(row.close_date) %}
  {{ close_date | datetimeformat('%e/%m/%Y') }} <br>
{% endfor %}

 

View solution in original post

1 Reply 1
ben-duchy
Solution
Contributeur de premier rang

Display HubDB Date Column

SOLVE

Ignore me, I needed to put the ' set close_date' within the loop - school boy error! 😣

 

{% set date_test = hubdb_table_rows(1234567) %}

{% for row in date_test %}
  {% set close_date = unixtimestamp(row.close_date) %}
  {{ close_date | datetimeformat('%e/%m/%Y') }} <br>
{% endfor %}