diff options
author | Chirag Aggarwal <me@chi6rag.net> | 2016-02-16 10:24:33 +0530 |
---|---|---|
committer | Chirag Aggarwal <me@chi6rag.net> | 2016-02-17 04:32:20 +0530 |
commit | 613bda5ad7a5d266d3f88fed7e4e425a0021f44a (patch) | |
tree | db31d553ad417de7fb3c727127bb71b3b84a034a /guides/source | |
parent | ac317e778a959468ef07779a4959ad49e8e9bbd6 (diff) | |
download | rails-613bda5ad7a5d266d3f88fed7e4e425a0021f44a.tar.gz rails-613bda5ad7a5d266d3f88fed7e4e425a0021f44a.tar.bz2 rails-613bda5ad7a5d266d3f88fed7e4e425a0021f44a.zip |
[ci skip] Updating edge rails guides to include `on_weekday?` on Date, Time and DateTime
[ci skip] Adding `on_weekend?` method in edge rails guides
Diffstat (limited to 'guides/source')
-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: |