Refine date comparison (timezones)
This commit is contained in:
parent
537178d991
commit
c2f1975499
2 changed files with 2 additions and 2 deletions
|
|
@ -50,7 +50,7 @@ def calculate_to_dates()
|
||||||
end
|
end
|
||||||
|
|
||||||
def conv_tz(t)
|
def conv_tz(t)
|
||||||
if (t.utc?)
|
if (t && t.class.method_defined?(:utc) && t.utc?)
|
||||||
Time.local(t.year, t.month, t.day, t.hour, t.min, t.sec)
|
Time.local(t.year, t.month, t.day, t.hour, t.min, t.sec)
|
||||||
else
|
else
|
||||||
t
|
t
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
def expand_event_list(itemId, defaultTitle = nil, skipIfDatePresent = false)
|
def expand_event_list(itemId, defaultTitle = nil, skipIfDatePresent = false)
|
||||||
@items[itemId][:events].each_with_index do |event,n|
|
@items[itemId][:events].each_with_index do |event,n|
|
||||||
if (!skipIfDatePresent || !@items.any?{ |i| i[:startdate]==event[:startdate] })
|
if (!skipIfDatePresent || !@items.any?{ |i| conv_tz(i[:startdate])==conv_tz(event[:startdate]) })
|
||||||
metadata = {
|
metadata = {
|
||||||
:title => defaultTitle,
|
:title => defaultTitle,
|
||||||
:public => true
|
:public => true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue