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 16 16 end 17 17 18 18 module ClassMethods 19 # Returns a new Date representing the date 1 day ago (i.e. yesterday's date). 19 20 def yesterday 20 21 ::Date.today.yesterday 21 22 end 22 23 24 # Returns a new Date representing the date 1 after today (i.e. tomorrow's date). 23 25 def tomorrow 24 26 ::Date.today.tomorrow 25 27 end 26 28 end 27 29 28 30 # Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) 29 31 # and then subtracts the specified number of seconds 30 32 def ago(seconds)