time_zone_ext 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -1
- data/lib/time_zone_ext.rb +1 -1
- data/lib/time_zone_ext/version.rb +1 -1
- data/spec/time_zone_ext_spec.rb +5 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/lib/time_zone_ext.rb
CHANGED
@@ -7,7 +7,7 @@ module TimeZoneExt
|
|
7
7
|
if format =~ /%z/i
|
8
8
|
DateTime.strptime(date, format).in_time_zone
|
9
9
|
else
|
10
|
-
DateTime.strptime("#{date} zone#{
|
10
|
+
DateTime.strptime("#{date} zone#{formatted_offset}", "#{format} zone%z").in_time_zone
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
data/spec/time_zone_ext_spec.rb
CHANGED
@@ -16,4 +16,9 @@ describe TimeZoneExt do
|
|
16
16
|
it "parses time without explicitly specified timezone" do
|
17
17
|
Time.zone.strptime("2012-06-02 00:00", "%Y-%m-%d %H:%M").to_s.should == "2012-06-02 00:00:00 -0500"
|
18
18
|
end
|
19
|
+
|
20
|
+
it "parses time with named time zone" do
|
21
|
+
Time.zone = "Moscow"
|
22
|
+
Time.zone.strptime("2012-06-02 00:00", "%Y-%m-%d %H:%M").to_s.should == "2012-06-02 00:00:00 +0400"
|
23
|
+
end
|
19
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time_zone_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
segments:
|
111
111
|
- 0
|
112
|
-
hash:
|
112
|
+
hash: -635974733064479003
|
113
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
114
|
none: false
|
115
115
|
requirements:
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
segments:
|
120
120
|
- 0
|
121
|
-
hash:
|
121
|
+
hash: -635974733064479003
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
124
|
rubygems_version: 1.8.24
|