Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Use `DateTime.parse` inside `String#to_datetime` | Andrew White | 2013-01-21 | 1 | -8/+1 |
| | | | | | | | | | | Use the standard library's `DateTime.parse` because it's marginally faster and supports partial date/time strings. Benchmark: user system total real old 3.980000 0.000000 3.980000 ( 3.987606) new 3.640000 0.010000 3.650000 ( 3.641342) | ||||
* | Standardise the return value of `to_time` | Andrew White | 2013-01-21 | 1 | -17/+27 |
| | | | | | | | | | | | | | | | | | | | | | | 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 | ||||
* | Better error message for String#to_date | Kelly Stannard | 2013-01-04 | 1 | -5/+1 |
| | | | | | | | | | | I did this because to_date gives a very unhelpful error message if you do not pass in a correct date. In the process I think this cleans up the code nicely and even better it tends to be slightly faster than the current implementation. Benchmark https://gist.github.com/4440875 | ||||
* | Deprecate obsolete Time to DateTime fallback methods | Andrew White | 2012-12-11 | 1 | -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. | ||||
* | String.to_time documentation along examples. | Adam Stankiewicz | 2012-09-24 | 1 | -1/+11 |
| | |||||
* | removing trailing spaces | Francesco Rodriguez | 2012-05-11 | 1 | -3/+3 |
| | |||||
* | added docs to String#to_datetime | Francesco Rodriguez | 2012-05-11 | 1 | -0/+6 |
| | |||||
* | added docs to String#to_date | Francesco Rodriguez | 2012-05-11 | 1 | -0/+6 |
| | |||||
* | AS core_ext refactoring | Alexey Gaziev | 2012-04-29 | 1 | -10/+22 |
| | |||||
* | no more need to make Time#to_date and Time#to_datetime public | Sergey Nartimov | 2011-12-22 | 1 | -1/+0 |
| | | | | they are public in actual 1.9 ruby version (tested at least in 1.9.2-p180) | ||||
* | remove support for ruby 1.8 in AS String extensions | Sergey Nartimov | 2011-12-21 | 1 | -29/+0 |
| | |||||
* | adds a couple of missing magic comments [fixes #1374] | Xavier Noria | 2011-07-23 | 1 | -0/+1 |
| | |||||
* | Make String.to_time respect timezones | Nate Mueller | 2011-06-02 | 1 | -2/+2 |
| | |||||
* | Implemented getbyte as an aliased method and RDoc added | Santiago Pastorino | 2010-06-28 | 1 | -3/+2 |
| | | | | Signed-off-by: Xavier Noria <fxn@hashref.com> | ||||
* | Makes more sense to ask about method_defined? | Santiago Pastorino | 2010-06-28 | 1 | -1/+1 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Added getbyte as a core_ext to Ruby < 1.9 | Santiago Pastorino | 2010-06-27 | 1 | -0/+4 |
| | | | | Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Move constantize from conversions to inflections. | Santiago Pastorino | 2010-06-26 | 1 | -11/+0 |
| | | | | | | | | This removes ActiveModel dependency on TZInfo. [#4979 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | ActiveSupport::Dependencies.constantize shortcut for caching named constant ↵ | Jeremy Kemper | 2010-06-05 | 1 | -0/+11 |
| | | | | lookups | ||||
* | updates String#to_(date|date_time|time) to return nil for blank strings | Daniel Neighman | 2010-04-21 | 1 | -0/+3 |
| | |||||
* | much complete rdoc for String#ord | Xavier Noria | 2010-04-19 | 1 | -3/+19 |
| | |||||
* | revises the rdoc of String#ord | Xavier Noria | 2010-04-19 | 1 | -1/+5 |
| | |||||
* | require publicize_conversion_method to ensure to_date and to_datetime became ↵ | Santiago Pastorino | 2010-02-19 | 1 | -0/+1 |
| | | | | public before redefining them (avoid warnings) | ||||
* | String #to_time and #to_datetime: handle fractional seconds [#864 ↵ | Jason Frey (Fryguy) | 2009-06-07 | 1 | -2/+6 |
| | | | | state:resolved] | ||||
* | Prefer behavior check to RUBY_VERSION to catch 1.8 backports | Jeremy Kemper | 2009-04-29 | 1 | -1/+1 |
| | |||||
* | Fix dependencies revealed by testing in isolation | Jeremy Kemper | 2009-04-22 | 1 | -0/+1 |
| | |||||
* | Convert String conversions, filters, starts/ends_with, and multibyte ↵ | Jeremy Kemper | 2009-03-28 | 1 | -21/+14 |
| | | | | extension modules to class reopen | ||||
* | Ruby 1.9 compat: don't use obsolete ParseDate | Jeremy Kemper | 2007-12-27 | 1 | -4/+4 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8490 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Ruby 1.9 compat: 'a'.ord == 'a'[0] | Jeremy Kemper | 2007-12-15 | 1 | -2/+7 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Honor Ruby's default calendar reform setting when creating DateTime objects ↵ | Geoff Buesing | 2007-11-24 | 1 | -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 | ||||
* | String#to_time overflows to DateTime. Add String#to_datetime. Closes #8572. | Jeremy Kemper | 2007-06-04 | 1 | -1/+5 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6935 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Added String#to_time and String#to_date for wrapping ParseDate | David Heinemeier Hansson | 2005-03-02 | 1 | -0/+19 |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@824 5ecf4fe2-1ee6-0310-87b1-e25e094e27de |