0

I want to hide some data after the 10th day of every month. How can I implement this check?

I dont want to make any function in the views . And there should be something publicly used over the web site in Templates .

Ranbir Singh
  • 203
  • 3
  • 18
  • this question is the same earlier with this one: http://stackoverflow.com/questions/15402914/how-to-put-a-date-check-in-django-templates. Same person? – catherine Mar 14 '13 at 07:19

3 Answers3

4

You can do this in template

{% if your_date.day < 10 %}
    {# show the data #}
{% else %}
    {# hide data #}
{% endif %}
Rohan
  • 52,392
  • 12
  • 90
  • 87
3
{% if date.day <= 10 %}
    //show data
{% else %}
    //no data
{% endif %}
catherine
  • 22,492
  • 12
  • 61
  • 85
1

This is literally the exact same question as this one: get particular date in django template Django

I answered completely in that one.

Community
  • 1
  • 1
Jack Shedd
  • 3,501
  • 20
  • 27