I’ve been tasked with displaying rows based on a set of date ranges with an overall number of how many rows meet this criteria. This date range will need to be editable within the page editor but for now I can’t even get a hard coded version to work!
I thought something along these lines, but no luck!
{% set table = hubdb_table_rows(12345467) %}
{% for row in table %}
{% set plot = unixtimestamp(row.plot_date) %}
{% set startdate1 = "01/07/2021"|strtodate("dd/MM/yyyy") %}
{% set enddate1 = "30/09/2021"|strtodate("dd/MM/yyyy") %}
{% if plot | datetimeformat('%e/%m/%Y') >= startdate1 %}
{% if plot | datetimeformat('%e/%m/%Y') <= enddate1 %}
Display row data
{% endif %}
{% endif %}
{% endfor %}
To summerise, it should show:
- Between 1 July 2020 – 30 September 2020
- Unsold Plots = 10
- Row(s) information displayed
- Reserved plots = 20
- Row(s) information displayed
- Exchanged plots = 25
- Row(s) information displayed
- Unsold Plots = 10
Total plots = 55
Any help would be greatly appreciated.