Skip to content

Commit c4c1bac

Browse files
committed
Add #weeks_since in active_support_core_extensions.md guide [ci skip]
1 parent 1b226d5 commit c4c1bac

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

guides/source/active_support_core_extensions.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3399,18 +3399,19 @@ NOTE: Defined in `active_support/core_ext/date_and_time/calculations.rb`.
33993399
[DateAndTime::Calculations#months_ago]: https://api.rubyonrails.org/classes/DateAndTime/Calculations.html#method-i-months_ago
34003400
[DateAndTime::Calculations#months_since]: https://api.rubyonrails.org/classes/DateAndTime/Calculations.html#method-i-months_since
34013401

3402-
##### `weeks_ago`
3402+
##### `weeks_ago`, `weeks_since`
34033403

3404-
The method [`weeks_ago`][DateAndTime::Calculations#weeks_ago] works analogously for weeks:
3404+
The method [`weeks_ago`][DateAndTime::Calculations#weeks_ago] and [`weeks_since`][DateAndTime::Calculations#week_since] work analogously for weeks:
34053405

34063406
```ruby
3407-
Date.new(2010, 5, 24).weeks_ago(1) # => Mon, 17 May 2010
3408-
Date.new(2010, 5, 24).weeks_ago(2) # => Mon, 10 May 2010
3407+
Date.new(2010, 5, 24).weeks_ago(1) # => Mon, 17 May 2010
3408+
Date.new(2010, 5, 24).weeks_since(2) # => Mon, 07 Jun 2010
34093409
```
34103410

34113411
NOTE: Defined in `active_support/core_ext/date_and_time/calculations.rb`.
34123412

34133413
[DateAndTime::Calculations#weeks_ago]: https://api.rubyonrails.org/classes/DateAndTime/Calculations.html#method-i-weeks_ago
3414+
[DateAndTime::Calculations#weeks_since]: https://api.rubyonrails.org/classes/DateAndTime/Calculations.html#method-i-weeks_since
34143415

34153416
##### `advance`
34163417

0 commit comments

Comments
 (0)