Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
jjb committed Apr 15, 2024
1 parent 76db389 commit 57f9d1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -291,7 +291,7 @@ def end_of_week(start_day = Date.beginning_of_week)
alias :at_end_of_week :end_of_week

def end_of_week_threshold(start_day = Date.beginning_of_week)
days_since(6 - days_to_week_start(start_day)).advance(days: 1)
days_since(6 - days_to_week_start(start_day)).advance(days: 1).beginning_of_day
end

# Returns Sunday of this week assuming that week starts on Monday.
Expand All @@ -310,7 +310,7 @@ def end_of_month

def end_of_month_threshold
last_day = ::Time.days_in_month(month, year)
days_since(last_day - day).advance(days: 1)
days_since(last_day - day).advance(days: 1).beginning_of_day
end

# Returns a new date/time representing the end of the year.
Expand Down
4 changes: 2 additions & 2 deletions activesupport/test/core_ext/time_ext_test.rb
Expand Up @@ -1273,11 +1273,11 @@ def test_all_month
end

def test_all_quarter
assert_equal Time.local(2011, 4, 1, 0, 0, 0)...Time.local(2011, 6, 30, 0, 0, 0), Time.local(2011, 6, 7, 10, 10, 10).all_quarter
assert_equal Time.local(2011, 4, 1, 0, 0, 0)...Time.local(2011, 7, 1, 0, 0, 0), Time.local(2011, 6, 7, 10, 10, 10).all_quarter
end

def test_all_year
assert_equal Time.local(2011, 1, 1, 0, 0, 0)...Time.local(2011, 12, 31, 0, 0, 0), Time.local(2011, 6, 7, 10, 10, 10).all_year
assert_equal Time.local(2011, 1, 1, 0, 0, 0)...Time.local(2012, 1, 1, 0, 0, 0), Time.local(2011, 6, 7, 10, 10, 10).all_year
end

def test_rfc3339_parse
Expand Down

0 comments on commit 57f9d1d

Please sign in to comment.