# How to display posts when date past

**URL:** <https://discourse.gohugo.io/t/how-to-display-posts-when-date-past/20964>\
**Category:** support\
**Created:** [September 25, 2019, 8:41am UTC](https://discourse.gohugo.io/t/how-to-display-posts-when-date-past/20964 "2019-09-25T08:41:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bensuperpc](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bensuperpc/32/9633_2.png) [@Bensuperpc](https://discourse.gohugo.io/u/Bensuperpc)\
**Post date:** [September 25, 2019, 8:41am UTC](https://discourse.gohugo.io/t/how-to-display-posts-when-date-past/20964/1 "2019-09-25T08:41:14Z")

</div>

I would like to display only posts when date past and display others in others menu, but I can not.

```
<h2>Events :</h2>
{{ range first 10 .Data.Pages }}
<!-- SI la page est un post -->
{{ if eq .Type "events" }}
<h2>
    <a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a>
</h2>

{{ end }}
<!-- Fin if -->
{{ end }}
<!-- Fin range -->

---

title: "Tester"

adress: ""

postalCode: "75000"

city: ""

label: ""

when: 2019-09-23T14:08:03+02:00

date: 2019-09-23T14:08:03+02:00

description: ""

photos: []

draf: false

important: true

association: ""

---
```

---

<div class="post-metadata">

**Author:** ![ju52](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/ju52/32/6749_2.png) [@ju52](https://discourse.gohugo.io/u/ju52)\
**Post date:** [September 25, 2019, 11:15am UTC](https://discourse.gohugo.io/t/how-to-display-posts-when-date-past/20964/2 "2019-09-25T11:15:58Z")

</div>

try to compare .Date with [now](https://gohugo.io/functions/now/)  
You can use AddDate function for calculations

`{{ if lt .Date now }}`
