# Filtering pages by upcoming or past dates in panel

**URL:** <https://forum.getkirby.com/t/filtering-pages-by-upcoming-or-past-dates-in-panel/33581>\
**Category:** Questions\
**Tags:** v4\
**Created:** [February 11, 2025, 9:21am UTC](https://forum.getkirby.com/t/filtering-pages-by-upcoming-or-past-dates-in-panel/33581 "2025-02-11T09:21:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![denkstream](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/denkstream/32/6628_2.png) [@denkstream](https://forum.getkirby.com/u/denkstream)\
**Post date:** [February 11, 2025, 9:21am UTC](https://forum.getkirby.com/t/filtering-pages-by-upcoming-or-past-dates-in-panel/33581/1 "2025-02-11T09:21:24Z")

</div>

Hi community,

I’m somewhat unsure how to achieve this, I made a two pages sections with events, every event has a date field. This is what blueprint looks like:

```auto
    sections:
      future-events:
        label: Aktuelle Veranstaltungen
        type: pages
        layout: table
        sortBy: date desc
        columns:
          date:
            label: Datum
            value: "{{ page.date.toDate('Y.m.d') }}"
        template:
          - event_single

      past-events:
        label: Vergangene Veranstaltungen
        type: pages
        layout: table
        sortBy: date desc
        columns:
          date:
            label: Datum
            value: "{{ page.date.toDate('Y.m.d') }}"
        template:
          - event_single

```

Now what I want to achieve, i want first section to show all events which are in future (or today) which the past-events should display events older than today. It should compare date field of event.

Probably it can be filtered though query, but how to do that?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [February 11, 2025, 1:31pm UTC](https://forum.getkirby.com/t/filtering-pages-by-upcoming-or-past-dates-in-panel/33581/2 "2025-02-11T13:31:42Z")

</div>

you can use the query option.

```auto
query: page.children.filterBy('date', 'date >', 'today')

```

> **[$pages-\>filterBy()](https://getkirby.com/docs/reference/objects/cms/pages/filter-by)**
>
> Alias for Kirby\\Toolkit\\Collection::filter

---

<div class="post-metadata">

**Author:** ![denkstream](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/denkstream/32/6628_2.png) [@denkstream](https://forum.getkirby.com/u/denkstream)\
**Post date:** [February 11, 2025, 1:38pm UTC](https://forum.getkirby.com/t/filtering-pages-by-upcoming-or-past-dates-in-panel/33581/3 "2025-02-11T13:38:34Z")

</div>

Thanks, that worked!
