- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Show HubDB entries till today
SOLVESep 11, 2018 3:39 AM
Hi,
a few weeks ago I've started this topic in which I've needed to add some "filter" to a module.
@tjoyce done a great job by helping me with it.
Now I need to add a constant "show entries, which has a expiry date till *today*". There is a Hub DB Column with a date entry which should work as the filter entry.
e.g
- Row1 has an expiry date of 12.09.2018(will be shown in the module)
- Row2 has an expiry date of 10.09.2018(won't be shown in the module, because the expiry date was yesterday)
....
I've found this topic and modified the solution for my needs. Unfortunately it doesn't work.
{% if (row['expiryDate']|datetimeformat('%Y-%m-%j')) >= (local_dt|datetimeformat('%Y-%m-%j')) %} *LISTING* {% endif %}
expiryDate = HubDB column name of the datepicker
datetimeformat '%Y-%m-%j' = the format how the HubDB table export(CSV/XLS) looks like.
I've also tried to change the local_dt|datetimeformat to the datetimeformat which is set in the HubSpot settings(it's set to "Germany" and the blog settings are set to "medium")...
What am I doing wrong?
regards
Anton
![]() | Did my post help answer your query? Help the Community by marking it as a solution |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Accepted Solutions
Sep 11, 2018 7:36 AM
Hey @Anton - I don't use HubDB a whole lot but, I thought dates were converted to Unix timestamps in your database record...
What is the output of
row['expiryDate']
does it look something like this? 1536665594000
If it does, then you can do this:
{% if (row['expiryDate'] >= unixtimestamp(local_dt) %} *LISTING* {% endif %}
If it doesn't, you may be able to do this:
{% if (unixtimestamp(row['expiryDate']) >= unixtimestamp(local_dt) %} *LISTING* {% endif %}
If this answer helped, please, mark as solved 😄
tim@belch.io | forms.belch.io | Design your own Beautiful HubSpot Forms; No coding necessary.
Drop by and say Hi to me on slack.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content