#  \[Proposal\] Add start\_day argument to this\_week? for consistency with all\_week and beginning\_of\_week

**URL:** <https://discuss.rubyonrails.org/t/proposal-add-start-day-argument-to-this-week-for-consistency-with-all-week-and-beginning-of-week/90168>\
**Category:** rubyonrails-core\
**Created:** [February 24, 2026, 8:07am UTC](https://discuss.rubyonrails.org/t/proposal-add-start-day-argument-to-this-week-for-consistency-with-all-week-and-beginning-of-week/90168 "2026-02-24T08:07:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![55728](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/55728/32/13985_2.png) [@55728](https://discuss.rubyonrails.org/u/55728)\
**Post date:** [February 24, 2026, 8:07am UTC](https://discuss.rubyonrails.org/t/proposal-add-start-day-argument-to-this-week-for-consistency-with-all-week-and-beginning-of-week/90168/1 "2026-02-24T08:07:32Z")

</div>

Hi everyone,

The recently introduced `this_week?` predicate method is a great addition — it makes time-range checks much more readable. However, I noticed that it doesn’t accept a `start_day` argument, unlike the related methods it depends on internally.

### Current behavior

```ruby
def this_week?
  ::Date.current.all_week.include?(to_date)
end

```

`this_week?` always uses the global `Date.beginning_of_week` setting. There is no way to specify the start day on a per-call basis.

### Inconsistency with existing API

Several related methods already accept a `start_day`argument:

- `all_week(start_day = Date.beginning_of_week)`

- `beginning_of_week(start_day = Date.beginning_of_week)`

- `end_of_week(start_day = Date.beginning_of_week)`

It feels natural and consistent for `this_week?` to follow the same pattern.

### Proposed change

```ruby
def this_week?(start_day = Date.beginning_of_week)
  ::Date.current.all_week(start_day).include?(to_date)
end

```

### Use case

For applications that need to handle multiple week-start conventions (e.g., `:sunday` in the US, `:monday`in Europe) within the same codebase, it’s useful to be able to specify `start_day` at the call site without changing the global configuration:

```ruby
date.this_week?(:sunday) # Check against Sun-Sat week
date.this_week?(:monday) # Check against Mon-Sun week
date.this_week? # Uses global default (unchanged)

```

This is a minimal, backward-compatible change — the default value preserves existing behavior.

I’m happy to submit a PR with the implementation and tests if this sounds reasonable.

Thanks for your feedback!

---

<div class="post-metadata">

**Author:** ![matthewd](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/matthewd/32/600_2.png) [@matthewd](https://discuss.rubyonrails.org/u/matthewd)\
**Post date:** [February 24, 2026, 5:46pm UTC](https://discuss.rubyonrails.org/t/proposal-add-start-day-argument-to-this-week-for-consistency-with-all-week-and-beginning-of-week/90168/2 "2026-02-24T17:46:48Z")

</div>

Yes please, I agree that sounds like a good follow-up!

---

<div class="post-metadata">

**Author:** ![55728](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/55728/32/13985_2.png) [@55728](https://discuss.rubyonrails.org/u/55728)\
**Post date:** [February 24, 2026, 10:25pm UTC](https://discuss.rubyonrails.org/t/proposal-add-start-day-argument-to-this-week-for-consistency-with-all-week-and-beginning-of-week/90168/3 "2026-02-24T22:25:46Z")

</div>

Thank you for the positive feedback, @matthewd!

I’ll open a PR shortly.

---

<div class="post-metadata">

**Author:** ![55728](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/55728/32/13985_2.png) [@55728](https://discuss.rubyonrails.org/u/55728)\
**Post date:** [March 13, 2026, 2:51am UTC](https://discuss.rubyonrails.org/t/proposal-add-start-day-argument-to-this-week-for-consistency-with-all-week-and-beginning-of-week/90168/4 "2026-03-13T02:51:51Z")

</div>

Hi, just a quick update — I opened the PR a couple of weeks ago: [https://github.com/rails/rails/pull/56872](https://github.com/rails/rails/pull/56872)

It’s a small change with tests, and fully backward-compatible. Happy to adjust anything if there are concerns about the approach.

---

<div class="post-metadata">

**Author:** ![55728](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/55728/32/13985_2.png) [@55728](https://discuss.rubyonrails.org/u/55728)\
**Post date:** [May 12, 2026, 10:36pm UTC](https://discuss.rubyonrails.org/t/proposal-add-start-day-argument-to-this-week-for-consistency-with-all-week-and-beginning-of-week/90168/5 "2026-05-12T22:36:21Z")

</div>

Closing the loop — the PR has been merged! 🎉 [https://github.com/rails/rails/pull/56872](https://github.com/rails/rails/pull/56872)

@matthewd Thank you for the early encouragement and for seeing this through to merge. Really appreciate it 😊
