Date filter today includes items from yesterday

Task type
Project
Changed

Context

The Today dashboard displays filters items that were last completed today.

The Chore's last chore log date field is a regular date field with no time, stored as Y-m-d.

The view's filter checks if field_last_chore_log_date = today.

This doesn't work because today is interpreted as midnight UTC and the calculated date can mismatch the user's date.

Using now instead of today could work.

Analysis

chores_dashboard filters on date-only fields (field_last_chore_log_date, field_next_due_date). Core's datetime Views filter (core/modules/datetime/src/Plugin/views/filter/Date.php, opSimple() and getOffset()) gets today wrong for them. With the "offset" (relative) value type, it:

  1. Parses the value in UTC. today snaps to midnight, so at 06:37 PDT it becomes 2026-10-27 00:00 UTC.
  2. Adds the site timezone's offset (America/Los_Angeles, −7h), giving 2026-10-26 17:00.
  3. Formats that as Y-m-d and compares it with the stored date.

The offset is meant to turn the current UTC time into local time. That only works if the time of day survives, and today has already been reset to midnight, so the result falls into the previous day. The SQL the Today display builds:

DATE_FORMAT(field_last_chore_log_date_value, '%Y-%m-%d') = DATE_FORMAT('2026-10-26T17:00:00', '%Y-%m-%d')
Operator Compares against Rows (2026-10-27, 06:37)
= today 2026-10-26 (yesterday) 12, yesterday's chores
> today after 2026-10-26 1, today's chore
>= today 2026-10-26 or later 13, both days

It also depends on the time of day. The UTC date rolls over at 17:00 PDT (16:00 PST):

Local time today becomes now becomes
06:37 2026-10-26 ✗ 2026-10-27 ✓
16:59 2026-10-26 ✗ 2026-10-27 ✓
17:30 2026-10-27 ✓ 2026-10-27 ✓
23:59 2026-10-27 ✓ 2026-10-27 ✓

So the current > today is only right until 5pm. After that, Today goes empty. It has no upper bound either, so it would also include a log dated in the future.

Other displays:

  • Daily uses <= today and = today with the offset type, so it is off by a day before 5pm.
  • Overdue (<= today) and Overdue page (< today) use the absolute "date" type, which adds no offset, so today is the UTC date. They are wrong the other way: after 5pm, chores due tomorrow count as overdue.
  • Weekly uses -3 days, which keeps the time of day, so it is correct.

Related Drupal core issues

None of them describes this exact cause: a relative today reset to UTC midnight, then shifted by the site's offset. Statuses as of 2026-10-27.

Same symptom, still open

Same mechanism, described in passing

Where the current code likely came from

Related but different bugs

Ideas

Use now (offset type) instead of today. now keeps the time of day, so after the offset it lands on the local date at any hour. Use +1 day / -1 day instead of tomorrow / yesterday, which also snap to midnight.

Report the cause on #2825127: a reproduction with the relative today, the explanation that getOffset() is applied after today has already been reset to UTC midnight, now as a workaround, and a pointer to #2868014 comment #66.

Questions

How is the time being compared? Answered above, under Context: today is taken as UTC midnight and then shifted by the site's UTC offset, which lands on yesterday before 17:00 local time.

TODO