Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveSupport Date.current differs from Date.today when Time.zone is set #416

Closed
wants to merge 8 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/active_support_date_current_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require_relative "test_helper"
require 'timecop'
require 'active_support'
require 'active_support/core_ext/date/calculations'

class TestActiveSupportDateCurrent < Minitest::Test
def test_date_current_same_as_date_today_with_time_zone
each_timezone do
Time.zone = "UTC"
Timecop.freeze("2024-03-15") do
assert_equal Date.current, Date.today
end
end
end
end