aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/values
Commit message (Collapse)AuthorAgeFilesLines
* Update Unicode Version to 9.0.0Fumiaki MATSUSHIMA2017-01-281-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 9.0.0 was released on June 21, 2016 http://blog.unicode.org/2016/06/announcing-unicode-standard-version-90.html http://www.unicode.org/versions/Unicode9.0.0/ There are some changes about grapheme cluster in Unicode 9.0.0: http://unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules ------------ I noticed that `unpack_graphemes` returns [Other] when the argument is Other ÷ Prepend (it must be [Other, Prepend]). But in [Unicode 8.0.0's Prepend has no characters](http://www.unicode.org/reports/tr29/tr29-27.html#Prepend) so we don't have to backport following patch: ```diff should_break = + if pos == eoc + true ```
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-6/+6
|
* Fix `ActiveSupport::TimeZone#strptime` cannot parse timestamps (%Q, %s)denisovlev2016-10-211-11/+15
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies remaining conventions across the projectXavier Noria2016-08-061-10/+10
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-5/+5
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-061-8/+8
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Raise ArgumentError for bad strptime argumentsJohn Gesimondo2016-07-111-0/+1
|
* Do not cache ActiveSupport::TimeZone#utc_offsetAlexey Shein2016-04-251-3/+1
| | | | | | | | | | | | | | | This can be an issue when TZInfo::TimeZone#current_period is refreshed due to timezone period transition, but it's not reflected in ActiveSupport::TimeZone object. For example, on Sun, 26 Oct 2014 22:00 UTC, Moscow changed its TZ from MSK +04:00 to MSK +03:00 (-1 hour). If ActiveSupport::TimeZone['Moscow'] happens to be initialized just before the timezone transition, it will cache its stale utc_offset even after the timezone transition. This commit removes cache and fixes this issue. Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* Add ActiveSupport::TimeZone.country_zones helperAndrey Novikov2016-04-191-1/+13
| | | | | | That helper will return time zones for any country that tzdata knows about. So it will be much simpler for non-US people to list own country time zones in HTML selects or anywhere.
* Remove unused try requireBart de Water2016-03-101-1/+0
|
* Fix wrong timezone mapping for Switzerland [22233]Kacper Walanus2015-11-151-1/+2
|
* Require only necessary concurrent-ruby classes.Jerry D'Antonio2015-11-041-1/+1
|
* Remove outdated statement about bundled TZInfo.Phil Ross2015-10-181-6/+0
| | | | | The bundled version of TZInfo referred to was removed from Active Support in version 3.0.
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2015-10-041-1/+1
|\
| * Renamed ‘Return’ to ‘Returns’ [ci skip]Ronak Jangir2015-09-281-1/+1
| |
* | Update docs for `formatted_offset` Ronak Jangir2015-09-291-2/+6
| | | | | | Output of `formatted_offset` is depends on input so it’s not always in +HH:MM format. Possible outputs are “+5:30”, “+530” or provided alternate UTC string [ci skip]
* | Replaced `ThreadSafe::Map` with successor `Concurrent::Map`.Jerry D'Antonio2015-09-191-2/+2
|/ | | | | | | The thread_safe gem is being deprecated and all its code has been merged into the concurrent-ruby gem. The new class, Concurrent::Map, is exactly the same as its predecessor except for fixes to two bugs discovered during the merge.
* Improve Docs of ActiveSupport::TimeZone [ci skip]amitkumarsuroliya2015-09-151-2/+2
| | | | | `TimeZone` class is a part of `ActiveSupport` module. For Accessing `TimeZone` class, we need to call `ActiveSupport::TimeZone` instead of `TimeZone`. individual `TimeZone` gives `NameError: uninitialized constant ‘TimeZone’ error
* Update Unicode Version to 8.0.0Anshul Sharma2015-09-041-0/+0
|
* Improve ActiveSupport::TimeWithZone conversion to YAMLAndrew White2015-04-221-0/+9
| | | | | | | | | | | Previously when converting AS::TimeWithZone to YAML it would be output as a UTC timestamp. Whilst this preserves the time information accurately it loses the timezone information. This commit changes that so that it is saved along with the time information. It also provides nicer encoding of AS::TimeZone instances themselves which previously embedded all of the data from the TZInfo records. Fixes #9183.
* Refactor ActiveSupport::Timezone#strptimeAndrew White2015-04-221-28/+35
| | | | | Make strptime behave more like parse when components are missing and share behavior between the two methods.
* Add ActiveSupport::TimeZone#strptime.Paul A Jungwirth2015-04-221-0/+20
| | | | This makes it easier to parse user-inputted times as from a given time zone.
* Revert "Take DST into account when locating TimeZone from Numeric."Andrew White2015-03-091-7/+1
| | | | | | | | | | | | | | | | Reverting this as it's not the implementation that we would like it to be. This is being used inside of ActiveSUpport::TimeZone[] and it's unaware of the context in which to find the timezone period so the timezone found changes depending on whether DST is in effect for the current period. This means that `'2001-01-01'.in_time_zone(-9)` changes from winter/summer even though it's the same date that we're trying to convert. Since finding timezones by numeric offsets is a bit hit and miss we should introduce a new API for finding them which supplies the date context in which we want to search and we should probably also deprecate the finding of timezones via the [] method, though this needs further discussion. This reverts commit 2cc2fa3633edd96773023c6b09d07c7b9d9b841d.
* Take DST into account when locating TimeZone from Numeric.Yasyf Mohamedali2015-03-031-1/+7
| | | | | | When given a specific offset, use the first result found where the total current offset (including any periodic deviations such as DST) from UTC is equal.
* make zones_map privateTony Miller2015-02-061-7/+8
| | | | | Conflicts: activesupport/lib/active_support/values/time_zone.rb
* Add missing time zone definitions for Russian FederationAndrey Novikov2015-01-131-1/+4
| | | | Also sync Russian Federation time zones with `zone.tab` file from tzdata version 2014j.
* Use directly TZInfo::Timezone without proxybrainopia2015-01-041-2/+2
| | | | | Since real timezone is loaded anyway in `#utc_offset` which is called during `#create`
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-1/+1
|
* Update to Unicode 7.0.0Benjamin Fleischer2014-11-151-0/+0
| | | | | | | | 7.0.0 was released on June 16, 2014 http://unicode-inc.blogspot.com.ar/2014/10/unicode-version-70-complete-text-of.html ruby bin/generate_tables
* Change `gsub` to `tr` where possibleAlexander Balashov2014-10-061-1/+1
|
* reduce object allocations in utc_offsetAaron Patterson2014-08-291-2/+2
| | | | | | `try` allocates an array on every call, we should avoid calling it in hotspots. This reduced AttributeMethodsTest#test_setting_time_zone_aware_attribute_with_string from 18k allocations to 14k
* Collected TimeZone's class methods togetherprintercu2014-05-171-70/+69
| | | | Just moved class methods up in file and moved `def self.` methods into `class << self`.
* Tidy up implementation of #15010Andrew White2014-05-111-7/+1
|
* Make TimeZone#parse behave more like Time#parse.Ulysse Carion2014-05-111-1/+12
| | | | | Namely, if the mday is omitted but any other upper components are, then instead of supplying the mday from the current time, it defaults to 1.
* make tests pass on Ruby 2.2Aaron Patterson2014-03-131-1/+1
| | | | | | Apparently we've been using a buggy feature for the past 6 years: https://bugs.ruby-lang.org/issues/9593
* Maintain current timezone when changing time during DST overlapAndrew White2014-01-261-0/+4
| | | | | | | | | | | | | | Currently if a time is changed during DST overlap in the autumn then the method `period_for_local` will return the DST period. However if the original time is not DST then this can be surprising and is not what is generally wanted. This commit changes that behavior to maintain the current period if it's in the list of periods returned by `periods_for_local`. It is possible to alter the behavior of `period_for_local` by specifying a second argument but since we may be change from another time that could be either DST or not then this would give inconsistent results. Fixes #12163.
* Check `respond_to` before delegation due to: ↵Aaron Patterson2014-01-091-0/+1
| | | | https://github.com/ruby/ruby/commit/d781caaf313b8649948c107bba277e5ad7307314
* Don't lazy load the tzinfo libraryAndrew White2014-01-011-19/+2
| | | | | | | | | Lazy loading the tzinfo library doesn't really buy us anything because the gem is installed as a dependency via the gemspec and if a developer is using Active Support outside of Rails then they can cherry pick which files to load anyway. Fixes #13553
* Update to Unicode 6.3.0Norman Clarke2013-12-271-0/+0
| | | | | | 6.3.0 was released on September 30, 2013. http://unicode-inc.blogspot.com.ar/2013/09/announcing-unicode-standard-version-63.html
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2013-12-201-2/+2
|\
| * Typos. return -> returns. [ci skip]Lauro Caetano2013-12-031-2/+2
| |
* | Add support for localized date referencesColin Bartlett2013-12-031-0/+10
| | | | | | | | | | | | | | Ruby's Date class automatically gives us #yesterday, #today, and #tomorrow. And ActiveSupport has a handy Time.zone.today for getting a localized version. But there was no localized version of #yesterday or #tomorrow. Until now.
* | Remove AS::TZ.lookup(name).thedarkone2013-08-071-5/+1
| | | | | | | | The method doesn't really make much sense (find_tzinfo will succeed for any imput provided).
* | Unify AS::TZ's lazy init maps.thedarkone2013-08-071-9/+5
| | | | | | | | There's no point in having 2 almost identical (@lazy_zones_map and @zones_map) lazy initialized TZ instance caches.
* | Use TS::Cache instead plain Hash in TimeZone.thedarkone2013-08-071-5/+7
|/ | | | Plain ruby Hashes are not thread safe.
* Add Chatham Islands Time (UTC+1245) support.Hiro Asari2013-04-121-1/+2
| | | | Also update the documentation on the number of supported time zones.
* Fixed timezone mapping of Ulaanbaatar.Zolzaya2013-03-271-1/+1
|
* Remove manual "return true" from AS::TZ match methodCarlos Antonio da Silva2013-03-121-1/+1
|
* included "Montevideo" in list of time zone aliases (closes Issue #9628)Gernot2013-03-091-0/+1
|