ice_cube 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/ice_cube/schedule.rb +7 -2
- data/lib/ice_cube/time_util.rb +1 -1
- data/lib/ice_cube/version.rb +1 -1
- metadata +4 -4
data/lib/ice_cube/schedule.rb
CHANGED
@@ -106,7 +106,10 @@ module IceCube
|
|
106
106
|
|
107
107
|
# Determine whether a given date appears in the times returned by the schedule
|
108
108
|
def occurs_on?(date)
|
109
|
-
|
109
|
+
if defined?(ActiveSupport::TimeWithZone) && @start_date.is_a?(ActiveSupport::TimeWithZone)
|
110
|
+
return active_support_occurs_on?(date)
|
111
|
+
end
|
112
|
+
# fall back to our own way of doing things
|
110
113
|
time_format = @start_date.utc? ? :utc : :local
|
111
114
|
self.occurrences_between(Time.send(time_format, date.year, date.month, date.day, 0, 0, 0), Time.send(time_format, date.year, date.month, date.day, 23, 59, 59)).any?
|
112
115
|
end
|
@@ -197,8 +200,10 @@ module IceCube
|
|
197
200
|
|
198
201
|
private
|
199
202
|
|
203
|
+
# We know that start_date is a time with zone - so check referencing
|
204
|
+
# The date in that time zone
|
200
205
|
def active_support_occurs_on?(date)
|
201
|
-
time = date.to_time
|
206
|
+
time = Time.zone.parse(date.to_s) # date.to_time.in_time_zone(@start_date.time_zone)
|
202
207
|
occurrences_between(time.beginning_of_day, time.end_of_day).any?
|
203
208
|
end
|
204
209
|
|
data/lib/ice_cube/time_util.rb
CHANGED
@@ -7,7 +7,7 @@ module IceCube
|
|
7
7
|
|
8
8
|
def self.serialize_time(time)
|
9
9
|
if time.is_a?(ActiveSupport::TimeWithZone)
|
10
|
-
{ :time => time, :zone => time.time_zone.
|
10
|
+
{ :time => time, :zone => time.time_zone.name }
|
11
11
|
elsif time.is_a?(Time)
|
12
12
|
time
|
13
13
|
end
|
data/lib/ice_cube/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ice_cube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 3
|
10
|
+
version: 0.6.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Crepezzi
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-10-
|
18
|
+
date: 2010-10-21 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|