Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | update AS/core_ext docs [ci skip] | Francesco Rodriguez | 2012-09-12 | 3 | -32/+41 |
| | |||||
* | Expand documentation for change() method in Time, Date, and DateTime | Jeff Shantz | 2012-08-29 | 1 | -2/+7 |
| | |||||
* | Improve performance of DateTime#seconds_since_unix_epoch | Andrew White | 2012-07-02 | 1 | -2/+5 |
| | | | | | | | | | | | | | | | | | | | Calculate the seconds since the UNIX epoch using the difference in Julian day numbers from the epoch date. By reducing the Rational math to just the offset component this gives a significant improvement. Benchmark: Calculating -------------------------------------------- new 27733 i/100ms current 15031 i/100ms new 27737 i/100ms current 15549 i/100ms -------------------------------------------------------- new 548182.1 (±0.9%) i/s - 2745567 in 5.008943s current 216380.9 (±1.6%) i/s - 1082232 in 5.002781s new 510281.9 (±1.2%) i/s - 2551804 in 5.001525s current 219858.3 (±1.8%) i/s - 1103979 in 5.023039s | ||||
* | Revert "Use strftime to convert DateTime to numeric" | Andrew White | 2012-07-01 | 1 | -1/+2 |
| | | | | | | | There appears to be a bug with DateTime#strftime("%s") on 32-bit platforms. Bug report: http://bugs.ruby-lang.org/issues/6683 This reverts commit 210cd756a628cc19c0d6e44bee8c33dfb2d9d598. | ||||
* | Remove DateTime#to_time override | Andrew White | 2012-07-01 | 1 | -14/+0 |
| | | | | | | | | Currently if the offset is not zero then to_time returns self which can lead to errors where a developer assumes that the value is a Time. To solve this we can use the native implementation of DateTime#to_time in Ruby 1.9.3 as it handles offsets properly and is faster than our override. | ||||
* | Use strftime to convert DateTime to numeric | Andrew White | 2012-07-01 | 1 | -2/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The native implementation of the seconds since the UNIX epoch in strftime is significantly faster than our method. Benchmark: ---------- require 'benchmark/ips' require 'date' require 'time' date = DateTime.civil(1253,7,6,20,4,0) Benchmark.ips do |x| x.report("strftime.to_i") { date.strftime('%s').to_i } x.report("ssue.to_i") { ((date - DateTime.civil(1970)) * 86400).to_i } x.report("strftime.to_f") { date.strftime('%s').to_f } x.report("ssue.to_f") { ((date - DateTime.civil(1970)) * 86400).to_f } end Output: ------- Calculating ------------------------------------- strftime.to_i 26480 i/100ms ssue.to_i 13818 i/100ms strftime.to_f 26561 i/100ms ssue.to_f 14479 i/100ms ------------------------------------------------- strftime.to_i 616937.3 (±2.4%) i/s - 3098160 in 5.024749s ssue.to_i 200108.8 (±6.9%) i/s - 994896 in 4.999278s strftime.to_f 553581.3 (±2.2%) i/s - 2788905 in 5.040397s ssue.to_f 204260.3 (±4.3%) i/s - 1028009 in 5.043072s | ||||
* | stop `to_s`ing method names | Akira Matsuda | 2012-06-06 | 1 | -1/+1 |
| | | | | Module#methods are Symbols in Ruby >= 1.9 | ||||
* | removing unnecessary 'examples' noise from activesupport | Francesco Rodriguez | 2012-05-13 | 2 | -3/+0 |
| | |||||
* | added beginning_of_hour support to core_ext calculations for Time and DateTime | Mark J. Titorenko | 2012-05-04 | 1 | -0/+11 |
| | |||||
* | String quotes and trailing spaces | Alexey Gaziev | 2012-04-29 | 1 | -1/+1 |
| | |||||
* | AS core_ext refactoring pt.2 | Alexey Gaziev | 2012-04-29 | 2 | -4/+10 |
| | |||||
* | AS core_ext refactoring | Alexey Gaziev | 2012-04-29 | 1 | -12/+21 |
| | |||||
* | Deprecate DateTime.local_offset | brainopia | 2012-01-25 | 2 | -2/+16 |
| | |||||
* | Merge pull request #4524 from nashby/datetime-18-code | José Valim | 2012-01-25 | 1 | -15/+0 |
|\ | | | | | remove ruby 1.8 related code | ||||
| * | remove ruby 1.8 related code | Vasiliy Ermolovich | 2012-01-18 | 1 | -15/+0 |
| | | |||||
* | | Update time zone offset information | brainopia | 2012-01-18 | 1 | -1/+1 |
|/ | |||||
* | revert "fixing some tests on ruby 1.9.3 SHA 33f222b" | Vishnu Atrai | 2012-01-07 | 1 | -23/+0 |
| | |||||
* | remove condition since to_time always available in ruby19 DateTime | Vishnu Atrai | 2011-12-31 | 1 | -1/+1 |
| | |||||
* | Initial pass at removing dead 1.8.x code from Active Support. | José Valim | 2011-12-20 | 2 | -3/+1 |
| | | | | | | 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. | ||||
* | Fix punctuation errors. | Sebastian Martinez | 2011-05-04 | 1 | -8/+8 |
| | |||||
* | added find_zone and find_zone! to AS timezones and changed the AS Railtie to ↵ | Josh Kalderimis | 2011-04-05 | 1 | -1/+1 |
| | | | | | | use find_zone! as well as adding Railtie tests Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | fixing some tests on ruby 1.9.3 | Aaron Patterson | 2011-03-07 | 1 | -0/+23 |
| | |||||
* | refactored Time#<=> and DateTime#<=> by removing unnecessary calls without ↵ | Diego Carrion | 2011-03-04 | 1 | -8/+2 |
| | | | | | | losing performance Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | updated Time, Date and DateTime current methods in AS to use Time.zone and ↵ | Josh Kalderimis | 2011-02-28 | 1 | -1/+2 |
| | | | | | | not Time.zone_default. [#6410 state:committed] | ||||
* | Preserve fractional seconds in DateTime#to_time | John Firebaugh | 2011-02-03 | 1 | -1/+1 |
| | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> | ||||
* | In AS, only inflector/methods is need in proxy_wrappers.rb, as well as date, ↵ | Josh Kalderimis | 2011-01-12 | 1 | -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> | ||||
* | Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵ | Santiago Pastorino | 2010-08-14 | 2 | -7/+7 |
| | | | | 's/[ \t]*$//' -i {} \;) | ||||
* | Refactor move some date, time and date_time methods to */zones and fixed ↵ | Santiago Pastorino | 2010-07-03 | 3 | -0/+4 |
| | | | | some requires | ||||
* | when the timezone is nil, a TimeWithZone object should not be constructed. ↵ | Aaron Patterson | 2010-06-17 | 1 | -0/+2 |
| | | | | | | [#4881 state:resolved] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | ||||
* | fix conditions when DateTime#to_date and DateTime#xmlschema methods are defined | Raimonds Simanovskis | 2010-06-04 | 1 | -3/+3 |
| | |||||
* | let Time.time_with_datetime_fallback handle properly years in the range 0..138 | Xavier Noria | 2010-05-05 | 1 | -0/+6 |
| | |||||
* | AS datetime conversions now require AS time conversions | snusnu | 2010-03-18 | 1 | -0/+1 |
| | |||||
* | date_time/calculations.rb needs active_support/core_ext/object/acts_like ↵ | Xavier Noria | 2010-01-01 | 1 | -0/+1 |
| | | | | because it uses acts_like? | ||||
* | Added #to_i to DateTime in ActiveSupport so #to_yaml works correctly on ↵ | Serguei Filimonov | 2009-12-15 | 1 | -2/+13 |
| | | | | ActiveRecord models with DateTime attributes. | ||||
* | Ruby 1.9.2: rational.rb is deprecated | Jeremy Kemper | 2009-11-02 | 1 | -1/+1 |
| | |||||
* | Check for date/time methods that moved upstream in 1.9 | Jeremy Kemper | 2009-05-07 | 1 | -3/+3 |
| | |||||
* | Convert DateTime extensions to class reopens | Jeremy Kemper | 2009-03-28 | 1 | -87/+75 |
| | |||||
* | Tease out Object#acts_like? behaviors | Jeremy Kemper | 2009-03-28 | 1 | -0/+13 |
| | |||||
* | Convert DateTime extension modules to class reopens | Jeremy Kemper | 2009-03-26 | 2 | -108/+111 |
| | |||||
* | Move Numeric#to_utc_offset_s to TimeZone.seconds_to_utc_offset | Jeremy Kemper | 2009-03-23 | 1 | -1/+1 |
| | |||||
* | Merge docrails | Pratik Naik | 2009-01-18 | 1 | -1/+1 |
| | |||||
* | Introduce convenience methods past?, today? and future? for Date and Time ↵ | Clemens Kofler | 2008-09-14 | 1 | -5/+19 |
| | | | | classes to facilitate Date/Time comparisons. | ||||
* | Improve documentation coverage and markup | Xavier Noria | 2008-05-02 | 1 | -2/+4 |
| | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | Ruby 1.8.7 compat: detect and alias non-superclass DateTime#to_s | Jeremy Kemper | 2008-04-20 | 1 | -4/+9 |
| | |||||
* | Add #getutc alias for DateTime#utc | gbuesing | 2008-04-12 | 1 | -0/+1 |
| | |||||
* | Improve documentation. | Pratik Naik | 2008-04-05 | 1 | -1/+1 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9226 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Fine, warn. Just don't recurse to death in cc.rb | Jeremy Kemper | 2008-03-31 | 1 | -1/+1 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9161 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Always alias DateTime#to_s to #to_default_s | Jeremy Kemper | 2008-03-31 | 1 | -1/+1 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Play nice with 1.9's DateTime#to_s | Jeremy Kemper | 2008-03-29 | 1 | -1/+2 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9137 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Adding TimeZone#at and DateTime#to_f | Geoff Buesing | 2008-03-17 | 1 | -0/+6 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9042 5ecf4fe2-1ee6-0310-87b1-e25e094e27de |