aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/date/conversions.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-011-3/+3
|
* Add missing periodsJon Moss2017-04-171-2/+2
| | | | [ci skip]
* Add (more) documentation to to_timeKen Mayer2017-04-171-0/+3
| | | | | There's a difference in the results between `Date#to_time(:local)` and `Date#in_time_zone` but it is subtle and can confuse users (like me :-).
* modernizes hash syntax in activesupportXavier Noria2016-08-061-7/+7
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-10/+10
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Don't blank pad day of the month when formatting datesSean Griffin2016-06-021-3/+3
| | | | | | | | | | | We are currently using `%e` which adds a space before the result if the digit is a single number. This leads to strings like `February 2, 2016` which is undesireable. I've opted to replace with 0 padding instead of removing the padding entirely, to preserve compatibility for those relying on the fact that the width is constant, and to be consistent with time formatting. Fixes #25251.
* Raise `ArgumentError` when an invalid form is passed to `Date#to_time`yui-knk2016-04-171-0/+1
| | | | | | | | Before this commit `NoMethodError: undefined method `form_name' for Time:Class` is raised when an invalid argument is passed. It is better to raise `ArgumentError` and show list of valid arguments to developers.
* Corrected `to_time` output in ActiveSupport Date Conversion docs.Since ↵amitkumarsuroliya2015-09-181-3/+3
| | | | | https://github.com/rails/rails/commit/48583f8bf74d1cefefea3cd6591bd546a9eaff6c, to_time returns times formatted as YYYY-MM-DD HH:MM:SS UTC [ci skip] `to_time` method now returns in `YYYY-MM-DD HH:MM:SS UTC` format.
* [skip ci] Update documentation for Date classAnton Davydov2015-05-211-0/+6
|
* Avoid raising a NameError on FreeBSD using DateRobin Dupret2014-01-011-2/+5
| | | | | | | | | | | | The Date object has a xmlschema method starting with Ruby 1.9 so we were assuming that we could safely remove this method and redefine it later but the call to remove_method throws a NameError on FreeBSD so we should rely on remove_possible_method instead. This call is actually needed to avoid warnings when running the test suite. Fixes #11723
* doc: date/conversions.rb should talk about date format not time format.Yves Senn2013-12-101-2/+2
| | | | | | Closes #13245. [ci skip]
* Fix handling of offsets with Time#to_s(:iso8601)Andrew White2013-07-291-1/+3
| | | | | | Use a lambda to ensure that the generated string respects the offset of the time value. Also add DateTime#to_s(:iso8601) and Date#to_s(:iso8601) for completeness.
* remove unused requireTomohiko Himura2013-04-251-1/+0
| | | | not used remove_possible_method
* remove_possible_method -> remove_methodNihad Abbasov2013-01-111-2/+2
| | | | Date#to_time and Date#xmlschema methods defined in Ruby 1.9.3
* Deprecate obsolete Time to DateTime fallback methodsAndrew White2012-12-111-1/+1
| | | | | | | The Time.time_with_datetime_fallback, Time.utc_time and Time.local_time methods were added to handle the limitations of Ruby's native Time implementation. Those limitations no longer apply so we are deprecating them in 4.0 and they will be removed in 4.1.
* Deprecate Date#to_time_in_current_zoneAndrew White2012-12-111-1/+1
| | | | | | | | | | | | | The to_time_in_current_zone method doesn't match the naming of the methods for converting to ActiveSupport::TimeWithZone on Time and DateTime. Since DateTime inherits from Date that has led to confusion with some users using the to_time_in_current_zone method with DateTime instances and having the time part dropped and the UTC offset lost. This commit fixes this by deprecating the old method and adding a new in_time_zone method which matches the naming for DateTime and Time. This should prevent accidently dropping times and UTC offsets when converting DateTime instances to ActiveSupport::TimeWithZone.
* update AS/core_ext docs [ci skip]Francesco Rodriguez2012-09-121-1/+1
|
* removing unnecessary 'examples' noise from activesupportFrancesco Rodriguez2012-05-131-2/+0
|
* String quotes and trailing spacesAlexey Gaziev2012-04-291-7/+7
|
* AS core_ext refactoringAlexey Gaziev2012-04-291-1/+4
|
* Initial pass at removing dead 1.8.x code from Active Support.José Valim2011-12-201-23/+0
| | | | | | There are a bunch of other implicit branches that adds 1.8.x specific code that still needs to be removed. Pull requests for those cases are welcome.
* Better use #remove_possible_method hereSebastian Martinez2011-05-081-2/+3
|
* Add Date#rfc3339 and Date#iso8601 to ASSantiago Pastorino2011-02-131-0/+6
|
* In AS, only inflector/methods is need in proxy_wrappers.rb, as well as date, ↵Josh Kalderimis2011-01-121-1/+1
| | | | | | date_time, and time conversions.rb. This fixes an issue when requiring json and AS saying that i18n is also required. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Move Date#xmlschema to conversions and add a missing requireSantiago Pastorino2010-07-041-2/+10
|
* Refactor move some date, time and date_time methods to */zones and fixed ↵Santiago Pastorino2010-07-031-18/+0
| | | | some requires
* Date#since, #ago, #beginning_of_day, #end_of_day, #xmlschema return ↵Geoff Buesing2010-06-121-1/+11
| | | | | | TimeWithZone when Time.zone_default is set Signed-off-by: Xavier Noria <fxn@hashref.com>
* date/conversions needs time/calculations for (utc|local)_timeXavier Noria2010-05-031-0/+1
|
* Fixes Dependency bug in ActiveSupportYehuda Katz2009-12-201-0/+1
|
* Repair time dependenciesJeremy Kemper2009-11-141-3/+0
|
* Clarify date/time dependenciesJeremy Kemper2009-11-021-0/+1
|
* Fix dependencies revealed by testing in isolationJeremy Kemper2009-04-221-0/+2
|
* Convert Date calculations and conversions extension modules to class reopensJeremy Kemper2009-03-281-96/+86
|
* Merge docrailsPratik Naik2009-01-181-3/+3
|
* Simplify to_formatted_s docs. Closes #10747 [Jeremy Kemper]Jeremy Kemper2008-01-091-24/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8608 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document date and time to_formatted_s. Closes #10747 [leethal]Jeremy Kemper2008-01-091-1/+21
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8606 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Moved the caching stores from ActionController::Caching::Fragments::* to ↵David Heinemeier Hansson2008-01-031-0/+1
| | | | | | ActiveSupport::Cache::*. If you're explicitly referring to a store, like ActionController::Caching::Fragments::MemoryStore, you need to update that reference with ActiveSupport::Cache::MemoryStore [DHH] Deprecated ActionController::Base.fragment_cache_store for ActionController::Base.cache_store [DHH] All fragment cache keys are now by default prefixed with the 'views/' namespace [DHH] Added ActiveRecord::Base.cache_key to make it easier to cache Active Records in combination with the new ActiveSupport::Cache::* libraries [DHH] Added ActiveSupport::Gzip.decompress/compress(source) as an easy wrapper for Zlib [Tobias Luetke] Included MemCache-Client to make the improved ActiveSupport::Cache::MemCacheStore work out of the box [Bob Cottrell, Eric Hodel] Added config.cache_store to environment options to control the default cache store (default is FileStore if tmp/cache is present, otherwise MemoryStore is used) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8546 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: normalize date and time xmlschema to match Ruby's ↵Jeremy Kemper2007-12-151-0/+3
| | | | | | formatting [chuyeow] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8398 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document Date conversions. Closes #10368 [chuyeow]Michael Koziarski2007-12-051-4/+34
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8279 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Honor Ruby's default calendar reform setting when creating DateTime objects ↵Geoff Buesing2007-11-241-1/+1
| | | | | | via ActiveRecord's Time -> DateTime overflow, Time#time_with_datetime_fallback, Time#to_datetime, Date#to_datetime and String#to_datetime. Closes #10201 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Date/Time/DateTime Ruby 1.9 compatJeremy Kemper2007-09-271-5/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7647 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Some 1.9 forward compatibilityJeremy Kemper2007-09-141-5/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7474 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Readable Date and DateTime#inspect. Closes #8570.Jeremy Kemper2007-06-041-0/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6933 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* DateTime#to_time converts to Time unless out of range. Date#to_datetime and ↵Jeremy Kemper2007-05-301-7/+11
| | | | | | Date#to_s(:rfc822). Closes #8512. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6902 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Date, Time, and DateTime support formatting blocks in addition to strftime ↵Jeremy Kemper2007-05-251-4/+13
| | | | | | strings. Introduce :long_ordinal format, e.g. 'February 21st, 2005'. Closes #8191. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6844 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* :db format for Date#to_sJeremy Kemper2007-01-281-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6060 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* DateTime#to_time gives hour/minute/second resolution. Closes #5747.Jeremy Kemper2006-08-071-4/+8
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4718 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Module#alias_attribute [Jamis/DHH]David Heinemeier Hansson2006-08-031-3/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4653 5ecf4fe2-1ee6-0310-87b1-e25e094e27de