Sha256: 55d5fa111a6e815362abf6fb70f0775014c013fd636ce41208974e06756dfb83

Contents?: true

Size: 281 Bytes

Versions: 20

Compression:

Stored size: 281 Bytes

Contents

# frozen_string_literal: true

# Requires `ActiveSupport::TimeWithZone` and `Time#to_local`
Date.class_eval do
  class << self
    # Returns today according to Eastern time
    #
    # @return [Date]
    #
    def todays_date
      Time.zone.now.to_local.to_date
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ruby-rails-extensions-2.1.1 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.14 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.13 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.12 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.11 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.10 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.9 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.8 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.7 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.6 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.5 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.4 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.3 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.2 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.1.0.pre.rc.1 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.0.1 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.0.1.pre.rc.1 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.0.0 lib/ruby-rails-extensions/extensions/todays_date.rb
ruby-rails-extensions-2.0.0.pre.rc.1 lib/ruby-rails-extensions/extensions/todays_date.rb