| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Useful for queries like:
Item.where(created_at: Date.current.all_day)
There was already a Time#all_day with the same behaviour, but for
queries like the above, Date is more convenient.
|
|\
| |
| |
| |
| | |
Conflicts:
guides/source/configuring.md
|
| | |
|
| |
| |
| |
| |
| | |
Follow up to
https://github.com/rails/rails/commit/c9c5788a527b70d7f983e2b4b47e3afd863d9f48
|
| |
| |
| |
| |
| |
| | |
https://github.com/rails/rails/commit/c9c5788a527b70d7f983e2b4b47e3afd863d9f48
[ci skip]
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Ruby 2.4 the `to_time` method for both `DateTime` and `Time` will
preserve the timezone of the receiver when converting to an instance
of `Time`. Since Rails 5.0 will support Ruby 2.2, 2.3 and later we
need to introduce a compatibility layer so that apps that upgrade do
not break. New apps will have a config initializer file that defaults
to match the new Ruby 2.4 behavior going forward.
For information about the changes to Ruby see:
https://bugs.ruby-lang.org/issues/12189
https://bugs.ruby-lang.org/issues/12271
Fixes #24617.
|
| |
|
| |
|
| |
|
|
|
| |
`DateTime.utc` is not a valid method. It gives `NoMethodError: undefined method `utc` for DateTime:Class`. As we know that we can calculate `utc` time from `Time` Class, but we can’t calculate `utc` time from `DateTime` Class.
|
| |
|
|
|
|
| |
core_ext/time"
|
|\
| |
| | |
Replace use of alias chains with prepend at core_ext/date and core_ext/time
|
| | |
|
|\ \
| |/
|/|
| | |
Amend `next_week` documentation [ci skip]
|
|/
|
|
| |
[skip ci]
|
|
|
|
|
|
|
|
| |
The build has failed when running the date/time ext tests in isolation
due to the missing extension, so better than adding a require is using
just Ruby in this case.
https://travis-ci.org/rails/rails/jobs/46107954#L1077
|
|
|
|
| |
Date, Time, and DateTime
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and DateTime
`#on_weekend?` returns true if the receiving date/time falls on a Saturday or
Sunday.
`#next_weekday` returns a new date/time representing the next day that does
not fall on a Saturday or Sunday.
`#prev_weekday` returns a new date/time representing the previous day that
does not fall on a Saturday or Sunday.
|
| |
|
| |
|
|
|
|
|
|
| |
Similar implementations of #in_time_zone exists for Date, Time and DateTime so
method is extracted into its own module. Also some logic is extracted into
private method.
|
| |
|
| |
|
| |
|
|
|
|
| |
option added (default is Monday)
|
| |
|
|
* Added the `DateAndTime::Calculations` module that is included in Time
and Date. It houses common calculations to reduce duplicated code.
* Simplified and cleaned-up the calculation code.
* Removed duplication in tests by adding a behavior module for shared
tests. I also added some missing tests.
|