diff options
author | Vipul A M <vipulnsward@gmail.com> | 2016-02-17 04:40:06 +0530 |
---|---|---|
committer | Vipul A M <vipulnsward@gmail.com> | 2016-02-17 04:40:06 +0530 |
commit | 32de1657a7211334fa0ef2dacc6c928d84839e7d (patch) | |
tree | db31d553ad417de7fb3c727127bb71b3b84a034a /guides | |
parent | ac317e778a959468ef07779a4959ad49e8e9bbd6 (diff) | |
parent | 613bda5ad7a5d266d3f88fed7e4e425a0021f44a (diff) | |
download | rails-32de1657a7211334fa0ef2dacc6c928d84839e7d.tar.gz rails-32de1657a7211334fa0ef2dacc6c928d84839e7d.tar.bz2 rails-32de1657a7211334fa0ef2dacc6c928d84839e7d.zip |
Merge pull request #23705 from chi6rag/master
[ci skip] Updating edge rails guides to include `on_weekday?` on Date, Time and DateTime
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/active_support_core_extensions.md | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/guides/source/active_support_core_extensions.md b/guides/source/active_support_core_extensions.md index 10122629b2..e66b9a4301 100644 --- a/guides/source/active_support_core_extensions.md +++ b/guides/source/active_support_core_extensions.md @@ -3078,7 +3078,7 @@ INFO: The following calculation methods have edge cases in October 1582, since d #### `Date.current` -Active Support defines `Date.current` to be today in the current time zone. That's like `Date.today`, except that it honors the user time zone, if defined. It also defines `Date.yesterday` and `Date.tomorrow`, and the instance predicates `past?`, `today?`, and `future?`, all of them relative to `Date.current`. +Active Support defines `Date.current` to be today in the current time zone. That's like `Date.today`, except that it honors the user time zone, if defined. It also defines `Date.yesterday` and `Date.tomorrow`, and the instance predicates `past?`, `today?`, `future?`, `on_weekday?` and `on_weekend?`, all of them relative to `Date.current`. When making Date comparisons using methods which honor the user time zone, make sure to use `Date.current` and not `Date.today`. There are cases where the user time zone might be in the future compared to the system time zone, which `Date.today` uses by default. This means `Date.today` may equal `Date.yesterday`. @@ -3467,6 +3467,8 @@ years_ago years_since prev_year (last_year) next_year +on_weekday? +on_weekend? ``` The following methods are reimplemented so you do **not** need to load `active_support/core_ext/date/calculations.rb` for these ones: @@ -3653,6 +3655,8 @@ years_ago years_since prev_year (last_year) next_year +on_weekday? +on_weekend? ``` They are analogous. Please refer to their documentation above and take into account the following differences: |