remove posts before today from listing view

Hello friends,

I have been asked to modify an event page to remove any events that are before today’s (or any arbitray date such as one month ago) date.

i have the events built through hubdb with a date field for the the event. it outputs a number that i was hoping to write something like

if eventdate > today then output the event

. I found this variable that ouputs today’s date: {{ local_dt }}. unfortunately, not an integer so would not work.

Any thoughts on this?

as always,

thanks

d

@dennisedson - What is the output of the HubDB? isn’t it just a timestamp, instead of a human readable date?

So it would be something like:

{{hubdb['date'] > unixtimestamp(local_dt) - (24 * 60 * 60 * 1000)}}


If this answer helped, please, mark as solved :grinning_face_with_smiling_eyes:


tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.

Drop by and say Hi to me on slack.

yeah, it outputs a timestamp. will try your solve

Thanks for speedy reply

@tjoyce,

it worked without the math at the end

{% for row in hubdb_table_rows(dynamic_page_hubdb_table_id, "&orderBy=start_date") %}

 {% for date in row.start_date %}
 {% set today = unixtimestamp(local_dt) %}	
 {% set eventDate = row.start_date %}

 {% if today < eventDate %}

 all that fun event content goes here!

 {% endif %}
 {% endfor %}
{% endfor %}