# How to filter today on weekday

**URL:** <https://community.directus.com/t/how-to-filter-today-on-weekday/725>\
**Category:** Help\
**Tags:** querying\
**Created:** [July 10, 2025, 10:22am UTC](https://community.directus.com/t/how-to-filter-today-on-weekday/725 "2025-07-10T10:22:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Nik](https://avatars.discourse-cdn.com/v4/letter/n/6de8d8/32.png) [@Nik](https://community.directus.com/u/Nik)\
**Post date:** [July 10, 2025, 5:38pm UTC](https://community.directus.com/t/how-to-filter-today-on-weekday/725/2 "2025-07-10T17:38:49Z")

</div>

First of all `weekday()` function is returning the index of the weekday from 0 to 6 where 0 is either Sunday or Monday (Monday in my case, not sure if this is influenced by any internationalization option).

Nevertheless I was not able to use weekday function passing dynamic $NOW `weekday($NOW)`.

I am not sure if there is an easier solution, but you can run a script operation to get the current weekday name prior to your data operation

```auto
module.exports = async function(data) {
	const today = new Date();
	const weekdayName = today.toLocaleDateString('en-US', { weekday: 'long' });
	return weekdayName;
}

```

and then use the ($last) result in the following data operation

```auto
{
    "filter": {
        "day_name": {
            "_eq": "{{$last}}"
        }
    }
}

```

 ![Snag_4211a97](https://us1.discourse-cdn.com/flex002/uploads/directus/original/1X/577eb7f1a08637c2fcc995a68b969b8c4382e56f.png)

---

_[View the full topic](https://community.directus.com/t/how-to-filter-today-on-weekday/725)._
