- 07 3月, 2018 1 次提交
-
-
由 Nick Holden 提交于
Equality comparisons between dates and times can take some extra time to comprehend. I tend to think of a date or time as "before" or "after" another date or time, but I naturally read `<` and `>` as "less than" and "greater than." This change seeks to make date/time comparisons more human readable.
-
- 11 7月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
-
- 09 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 02 7月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
This reverts commit 3420a145, reversing changes made to afb66a5a.
-
- 01 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 02 3月, 2017 1 次提交
-
-
由 Andrew White 提交于
Adding support for these options now allows us to update the `DateTime#end_of` methods to match the equivalent `Time#end_of` methods, e.g: datetime = DateTime.now.end_of_day datetime.nsec == 999999999 # => true Fixes #21424.
-
- 07 8月, 2016 2 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
-
- 24 4月, 2016 3 次提交
-
-
由 Andrew White 提交于
Previously these methods could return either a DateTime or a Time depending on how the ActiveSupport::TimeWithZone instance had been constructed. Changing to always return an instance of Time eliminates a possible stack level too deep error in to_time where it was wrapping a DateTime instance. As a consequence of this the internal time value is now always an instance of Time in the UTC timezone, whether that's as the UTC time directly or a representation of the local time in the timezone. There should be no consequences of this internal change and if there are it's a bug due to leaky abstractions.
-
由 Andrew White 提交于
Mirrors the Time#subsec method by returning the fraction of the second as a Rational.
-
由 Andrew White 提交于
-
- 23 4月, 2016 1 次提交
-
-
由 yui-knk 提交于
`DateTime#getlocal` is newly added public API. It's responsible is same as `DateTime#utc`, so `calculations.rb` is a best plase to define this method. For keeping consistency with `DateTime#utc`, defines `#localtime` and defines `getlocal` as an alias method.
-
- 04 4月, 2016 1 次提交
-
-
由 Andrew White 提交于
The native DateTime#<=> implementation can be used to compare instances with numeric values being considered as astronomical julian day numbers so we should call that instead of returning nil. Fixes #24228.
-
- 06 1月, 2015 1 次提交
-
-
由 pocke 提交于
before: p Time.now == 'a' # => false p Time.now <=> 'a' # => nil require 'active_support' require 'active_support/core_ext' p Time.now == 'a' # => false p Time.now <=> 'a' # => invalid date (ArgumentError) and on ruby 2.2, Time.now == 'a' warning. warning: Comparable#== will no more rescue exceptions of #<=> in the next release. warning: Return nil in #<=> if the comparison is inappropriate or avoid such comparison. after: - Error handling. - Quiet warnings.
-
- 05 12月, 2014 1 次提交
-
-
由 claudiob 提交于
Adds examples and keeps coherent with the documentation of the similar method `seconds_until_end_of_day`. [ci skip]
-
- 07 8月, 2014 1 次提交
-
-
由 Rafael Mendonça França 提交于
Fixes #16406
-
- 10 1月, 2014 1 次提交
-
-
由 Aaron Patterson 提交于
Check `respond_to` before delegation due to: https://github.com/ruby/ruby/commit/d781caaf313b8649948c107bba277e5ad7307314
-
- 30 8月, 2013 1 次提交
-
-
由 Shay Davidson 提交于
You can now add partial days (e.g. 2.5.days) to `DateTime` with the advance method. This was acheived by mimicing the `advance` implementation in `Time`.
-
- 31 7月, 2013 1 次提交
-
-
由 Gilad Zohari 提交于
Methods: :past? and :future? are already defined identically in date_and_time/calculations.rb which is included in Date. Because DateTime is a subclass of Date, it can call them.
-
- 29 7月, 2013 1 次提交
-
-
由 Anatoli Makarevich 提交于
Added middle_of_day method to Date and DateTime
-
- 05 7月, 2013 1 次提交
-
-
由 Rashmi Yadav 提交于
-
- 04 7月, 2013 1 次提交
-
-
由 Arun Agrawal 提交于
-
- 04 5月, 2013 1 次提交
-
-
由 Aaron Patterson 提交于
commit 2683de5da85135e8d9fe48593ff6167db9d64b18 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:29:20 2013 -0700 cannot support infinite ranges right now commit cebb6acef2c3957f975f6db4afd849e535126253 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:26:12 2013 -0700 reverting infinity comparison commit 385f7e6b4efd1bf9b89e8d607fcb13e5b03737ea Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:23:28 2013 -0700 Revert "Added ability to compare date/time with infinity" This reverts commit 38f28dca. Conflicts: activesupport/CHANGELOG.md activesupport/lib/active_support/core_ext/numeric/infinite_comparable.rb activesupport/test/core_ext/date_ext_test.rb activesupport/test/core_ext/date_time_ext_test.rb activesupport/test/core_ext/numeric_ext_test.rb activesupport/test/core_ext/time_ext_test.rb activesupport/test/core_ext/time_with_zone_test.rb commit 0d799a188dc12b18267fc8421675729917610047 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:18:53 2013 -0700 Revert "Refactor infinite comparable definition a bit" This reverts commit dd3360e0. commit 42dec90e49745bbfae546f0560b8783f6b48b074 Author: Aaron Patterson <aaron.patterson@gmail.com> Date: Fri May 3 11:18:47 2013 -0700 Revert "Require 'active_support/core_ext/module/aliasing' in the infinite_comparable module" This reverts commit 7003e71c.
-
- 02 5月, 2013 1 次提交
-
-
由 Tomohiko Himura 提交于
DateTime defined in date.rb
-
- 25 2月, 2013 1 次提交
-
-
由 Chris Baynes 提交于
-
- 23 2月, 2013 1 次提交
-
-
由 Gert Goet 提交于
-
- 22 2月, 2013 1 次提交
-
-
由 Gagan Awhad 提交于
-
- 10 1月, 2013 1 次提交
-
-
由 Jakob Waller 提交于
-
- 04 1月, 2013 1 次提交
-
-
由 bUg 提交于
Date, DateTime, Time and TimeWithZone can now be compared to infinity, so it's now possible to create ranges with one infinite bound and date/time object as another bound. Ex.: @range = Range.new(Date.today, Float::INFINITY) Also it's possible to check inclusion of date/time in range with conversion. Ex.: @range.include?(Time.now + 1.year) # => true @range.include?(DateTime.now + 1.year) # => true Ability to create date/time ranges with infinite bound is required for handling postgresql range types.
-
- 11 12月, 2012 1 次提交
-
-
由 Andrew White 提交于
-
- 29 11月, 2012 1 次提交
-
-
由 Olek Janiszewski 提交于
-
- 30 10月, 2012 1 次提交
-
-
由 Alexey Gaziev 提交于
-
- 13 9月, 2012 1 次提交
-
-
由 Francesco Rodriguez 提交于
-
- 30 8月, 2012 1 次提交
-
-
由 Jeff Shantz 提交于
-
- 14 5月, 2012 1 次提交
-
-
由 Francesco Rodriguez 提交于
-
- 04 5月, 2012 1 次提交
-
-
由 Mark J. Titorenko 提交于
-
- 29 4月, 2012 1 次提交
-
-
由 Alexey Gaziev 提交于
-
- 26 1月, 2012 1 次提交
-
-
由 brainopia 提交于
-
- 18 1月, 2012 1 次提交
-
-
由 brainopia 提交于
-
- 07 1月, 2012 1 次提交
-
-
由 Vishnu Atrai 提交于
-