Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10375: document_date_calc_class_methods.diff

File document_date_calc_class_methods.diff, 0.9 kB (added by chuyeow, 10 months ago)
  • activesupport/lib/active_support/core_ext/date/calculations.rb

    old new  
    1616        end 
    1717 
    1818        module ClassMethods 
     19          # Returns a new Date representing the date 1 day ago (i.e. yesterday's date). 
    1920          def yesterday 
    2021            ::Date.today.yesterday 
    2122          end 
    22            
     23 
     24          # Returns a new Date representing the date 1 after today (i.e. tomorrow's date). 
    2325          def tomorrow 
    2426            ::Date.today.tomorrow 
    2527          end 
    2628        end 
    27          
     29 
    2830        # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) 
    2931        # and then subtracts the specified number of seconds 
    3032        def ago(seconds)