Class: Date
- Inherits:
-
Object
- Object
- Date
- Defined in:
- lib/pratt/core_ext/time.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#beginning_of_week ⇒ Date
Return “zero hour” of the first day of the, possibly shifted, week.
-
#end_of_week ⇒ Date
Return “last second” of the last day of the, possibly shifted, week.
Instance Method Details
#beginning_of_week ⇒ Date
Return “zero hour” of the first day of the, possibly shifted, week.
6 7 8 |
# File 'lib/pratt/core_ext/time.rb', line 6 def beginning_of_week (self - wday_offset).beginning_of_day end |
#end_of_week ⇒ Date
Return “last second” of the last day of the, possibly shifted, week.
14 15 16 |
# File 'lib/pratt/core_ext/time.rb', line 14 def end_of_week (beginning_of_week+6).end_of_day end |