# Problems use \`where\` with dates

**URL:** <https://discourse.gohugo.io/t/problems-use-where-with-dates/9427>\
**Category:** support\
**Created:** [November 30, 2017, 11:42pm UTC](https://discourse.gohugo.io/t/problems-use-where-with-dates/9427 "2017-11-30T23:42:27Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![stephenpiscura](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/stephenpiscura/32/10468_2.png) [@stephenpiscura](https://discourse.gohugo.io/u/stephenpiscura)\
**Post date:** [January 14, 2019, 3:18pm UTC](https://discourse.gohugo.io/t/problems-use-where-with-dates/9427/7 "2019-01-14T15:18:33Z")

</div>

Looking at [https://gohugohq.com/howto/compare-date-strings-in-hugo/](https://gohugohq.com/howto/compare-date-strings-in-hugo/) this is the closest i got to something that works:

```
{{ range .Pages.ByParam "event_date" }}
  {{ if (time .Params.event_date).After now }}
    ...
  {{ end }}
{{ end }}

```

I wanted to paginate, but, with with something like this, you end up with blank pages:

```
{{ range (.Paginator 6).Pages.ByParam "event_date" }}
  {{ if (time .Params.event_date).After now }}
    ...
  {{ end }}
{{ end }}

```

And attempting a `where` function in the range, instead of an `if` function after the range has begun, like this, only results in errors:

```
{{ range where (.Paginator 6).Pages (time .Params.event_date).After now }}
  ...
{{ end }}

```

But i think i’ve got my syntax wrong.

But perhaps others with benefit from the link above. It at least got me something working, albeit not exactly what i wanted.

---

_[View the full topic](https://discourse.gohugo.io/t/problems-use-where-with-dates/9427)._
