aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/time_with_zone.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix AS::TimeWithZone#as_json docsBogdan Gusiev2013-11-071-4/+4
| | | | According to 28ab79d7c579fa1d76ac868be02b38b02818428a
* Keep sub-second resolution when wrapping a DateTime valueAndrew White2013-06-131-5/+1
| | | | | | | Add `DateTime#usec` and `DateTime#nsec` so that `ActiveSupport::TimeWithZone` keeps sub-second resolution when wrapping a `DateTime` value. Fixes #10855
* `TimeWithZone` raises `NoMethodError` in proper context.Yves Senn2013-03-181-0/+2
| | | | | | | | | Closes #9772. `TimeWithZone` delegates everything to the wrapped `Time` object using `method_missing`. The result is that `NoMethodError` error will be raised in the context of `Time` which leads to a misleading debug output.
* Added `ActiveSupport::TimeWithZone#to_r` for `Time#at` compatibility.stopdropandrew2013-02-241-0/+4
|
* Modify TimeWithZone#as_json to return 3DP of sub-second accuracy by default, ↵James Harton2013-01-311-1/+1
| | | | since it's allowed by the spec and is very useful.
* Standardise the return value of `to_time`Andrew White2013-01-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | This commit standardises the return value of `to_time` to an instance of `Time` in the local system timezone, matching the Ruby core and standard library behavior. The default form for `String#to_time` has been changed from :utc to :local but research seems to suggest the latter is the more common form. Also fix an edge condition with `String#to_time` where the string has a timezone offset in it and the mode is :local. e.g: # Before: >> "2000-01-01 00:00:00 -0500".to_time(:local) => 2000-01-01 05:00:00 -0500 # After: >> "2000-01-01 00:00:00 -0500".to_time(:local) => 2000-01-01 00:00:00 -0500 Closes #2453
* Add more documentation to TimeWithZoneMatthew Stopa2013-01-011-0/+14
| | | | [ci skip]
* copy edits [ci skip]Vijay Dev2013-01-011-4/+3
|
* Add documentation for TimeWithZone methodsMatthew Stopa2012-12-311-3/+19
|
* Add documentation for the TimeWithZone#dst? method.Matthew Stopa2012-12-311-0/+6
| | | | [ci skip]
* 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.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-09-211-17/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: actionmailer/lib/action_mailer/base.rb activesupport/lib/active_support/configurable.rb activesupport/lib/active_support/core_ext/module/deprecation.rb guides/source/action_controller_overview.md guides/source/active_support_core_extensions.md guides/source/ajax_on_rails.textile guides/source/association_basics.textile guides/source/upgrading_ruby_on_rails.md While resolving conflicts, I have chosen to ignore changes done in docrails at some places - these will be most likely 1.9 hash syntax changes.
| * update AS docs [ci skip]Francesco Rodriguez2012-09-171-17/+24
| |
* | Fix #6962. AS::TimeWithZone#strftime responds incorrectly to %:z and %::z ↵kennyj2012-09-201-1/+4
|/ | | | format strings.
* removes usage of Object#in? from the code base (the method remains defined ↵Xavier Noria2012-08-061-2/+1
| | | | | | | | | | | | | | | | | | | by Active Support) Selecting which key extensions to include in active_support/rails made apparent the systematic usage of Object#in? in the code base. After some discussion in https://github.com/rails/rails/commit/5ea6b0df9a36d033f21b52049426257a4637028d we decided to remove it and use plain Ruby, which seems enough for this particular idiom. In this commit the refactor has been made case by case. Sometimes include? is the natural alternative, others a simple || is the way you actually spell the condition in your head, others a case statement seems more appropriate. I have chosen the one I liked the most in each case.
* Merge pull request #6183 from nashby/fix-issue-6179Jeremy Kemper2012-05-181-3/+12
|\ | | | | wrap time ranges with timezones
| * respect nsec in TimeWithZoneVasiliy Ermolovich + Sergey Nartimov2012-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | when we pass fractional usec to Time methods we should use Rational instead of Float because of accuracy problem Time.local(2011,6,12,23,59,59,999999.999).nsec # => 999999998 Time.local(2011,6,12,23,59,59,Rational(999999999, 1000)).nsec # => 999999999
| * wrap time ranges with timezones, closes #6179Vasiliy Ermolovich2012-05-171-2/+11
| |
* | removing unnecessary 'examples' noise from activesupportFrancesco Rodriguez2012-05-131-4/+0
| |
* | Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-05-081-1/+3
|\ \ | |/ |/|
| * Add missing public method doc to TimeWithZone.nameRob Zolkos2012-05-061-1/+3
| |
* | Use respond_to_missing for TimeWithZoneMarc-Andre Lafortune2012-05-051-3/+3
|/
* No need to override to_yaml method in ActiveSupport::TimeWithZoneRafael Mendonça França2012-01-041-7/+1
|
* No need to check if YAML::ENGINE is defined since ruby 1.9 does thatRafael Mendonça França2012-01-041-1/+1
|
* Fix inconsistencies with Time{WithZone}#{hash,eql?}Marc-Andre Lafortune2011-11-221-2/+5
|
* Fix a typo in dateSemyon Perepelitsa2011-09-121-1/+1
|
* Fix xmlschema output with fraction_digits >0shtirlic2011-07-111-1/+1
| | | | | Current implementation produce incorrect output when Time#usec returns integer < 100000, because to_s doesn't add leading zeros.
* Remove `#among?` from Active SupportPrem Sichanugrist2011-04-131-1/+1
| | | | | | After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now. It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
* Change Object#either? to Object#among? -- thanks to @jamesarosen for the ↵David Heinemeier Hansson2011-04-121-1/+1
| | | | suggestion!
* Using Object#in? and Object#either? in various placesPrem Sichanugrist2011-04-111-1/+2
| | | | There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
* added find_zone and find_zone! to AS timezones and changed the AS Railtie to ↵Josh Kalderimis2011-04-051-1/+1
| | | | | | use find_zone! as well as adding Railtie tests Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* refactored Time#<=> and DateTime#<=> by removing unnecessary calls without ↵Diego Carrion2011-03-041-1/+1
| | | | | | losing performance Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* prefering psych as the yaml parser if possible, fixing assertions for YAML ↵Aaron Patterson2011-01-211-0/+10
| | | | 1.1 compatibility
* make our yaml output consistentAaron Patterson2011-01-041-5/+1
|
* Duck typing hereSantiago Pastorino2010-11-111-1/+1
|
* Fix ActiveSupport::TimeWithZone#localtime method with DateTimeAlvaro Bautista2010-11-111-1/+1
| | | | | | [#5344 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Whitespace and example identationJosep M. Bach2010-08-151-0/+2
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-2/+2
| | | | 's/[ \t]*$//' -i {} \;)
* adding proper markup in commentsNeeraj Singh2010-07-231-2/+2
|
* shortening the sentences and removing fluffNeeraj Singh2010-07-231-4/+5
|
* Fix a bunch of minor spelling mistakesEvgeniy Dolzhenko2010-06-111-1/+1
|
* Changed the default ActiveSupport.use_standard_json_time_format from false ↵David Heinemeier Hansson2010-01-031-4/+3
| | | | | | to true and ActiveSupport.escape_html_entities_in_json from true to false to match previously announced Rails 3 defaults [DHH]
* time_with_zone.rb needs active_support/core_ext/object/acts_likeXavier Noria2010-01-011-0/+1
|
* Add TimeZone dependencyYehuda Katz2009-11-141-0/+2
|
* Repair time dependenciesJeremy Kemper2009-11-141-8/+0
|
* Clarify date/time dependenciesJeremy Kemper2009-11-021-0/+1
|
* JSON: split encoding and coercionJeremy Kemper2009-06-081-20/+21
|
* Now that we have a separate internal rails_to_json, use a separate circular ↵Jeremy Kemper2009-04-261-1/+1
| | | | reference stack instead of sticking it in the options hash
* Privatize rails_to_jsonJeremy Kemper2009-04-261-22/+20
|
* * Add pluggable JSON backends with support for the JSON gem. [rick]rick2009-04-231-1/+3
| | | | | | | | | | | | | | Example: ActiveSupport::JSON.backend = "JSONGem" All internal Rails JSON encoding is now handled by ActiveSupport::JSON.encode(). Use of #to_json is not recommended, as it may clash with other libraries that overwrite it. However, you can recover Rails specific functionality if you really want to use #to_json. gem 'json' ActiveSupport::JSON.backend = "JSONGem" class ActiveRecord::Base alias to_json rails_to_json end