HTML IF function with date.time

In my Django/Python app I have an queryset with 3 conditions:

queryset = Post.objects.filter(verifikacija='False', status='Zatvorena', - timedelta(days=30))

Now, I need to make those same conditions in my HTML IF function.

{% if user.is_superuser or user.is_staff %}
   {% if object.status == 'Zatvorena' and post.verifikacija != 'True' and post.date_zatvoreno__lte == - timedelta(days=30) %}
           <a class="btn btn-danger btn-sm mt-1 mb-1" href="{% url 'post-delete' %}">Delete</a>
   {% endif %}
{% endif %}

Problem is, I don't know how to check time or how to calculate time in HTML. Do I need to write a seperate script or?

Back to Top