Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/icalendar/util/kv.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ defmodule ICalendar.Util.KV do
"#{key}:#{lat};#{lon}\n"
end

def build(key, date = %DateTime{time_zone: "Etc/UTC"}) do
"#{key}:#{Value.to_ics(date)}\n"
end

def build(key, date = %DateTime{}) do
"#{key};TZID=#{date.time_zone}:#{Value.to_ics(date)}\n"
end
Expand Down
4 changes: 2 additions & 2 deletions test/icalendar/event_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ defmodule ICalendar.EventTest do

assert ics == """
BEGIN:VEVENT
DTEND;TZID=Etc/UTC:20151224T084500
DTSTART;TZID=Etc/UTC:20151224T083000
DTEND:20151224T084500
DTSTART:20151224T083000
END:VEVENT
"""
end
Expand Down
28 changes: 14 additions & 14 deletions test/icalendar_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ defmodule ICalendarTest do
VERSION:2.0
BEGIN:VEVENT
DESCRIPTION:Let's go see Star Wars.
DTEND;TZID=Etc/UTC:20151224T084500
DTSTART;TZID=Etc/UTC:20151224T083000
DTEND:20151224T084500
DTSTART:20151224T083000
SUMMARY:Film with Amy and Adam
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:A big long meeting with lots of details.
DTEND;TZID=Etc/UTC:20151224T223000
DTSTART;TZID=Etc/UTC:20151224T190000
DTEND:20151224T223000
DTSTART:20151224T190000
SUMMARY:Morning meeting
END:VEVENT
END:VCALENDAR
Expand All @@ -69,8 +69,8 @@ defmodule ICalendarTest do
VERSION:2.0
BEGIN:VEVENT
DESCRIPTION:Let's go see Star Wars\\, and have fun.
DTEND;TZID=Etc/UTC:20151224T084500
DTSTART;TZID=Etc/UTC:20151224T083000
DTEND:20151224T084500
DTSTART:20151224T083000
LOCATION:123 Fun Street\\, Toronto ON\\, Canada
SUMMARY:Film with Amy and Adam
END:VEVENT
Expand Down Expand Up @@ -123,14 +123,14 @@ defmodule ICalendarTest do
VERSION:2.0
BEGIN:VEVENT
DESCRIPTION:Let's go see Star Wars.
DTEND;TZID=Etc/UTC:20151224T084500
DTSTART;TZID=Etc/UTC:20151224T083000
DTEND:20151224T084500
DTSTART:20151224T083000
SUMMARY:Film with Amy and Adam
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:A big long meeting with lots of details.
DTEND;TZID=Etc/UTC:20151224T223000
DTSTART;TZID=Etc/UTC:20151224T190000
DTEND:20151224T223000
DTSTART:20151224T190000
SUMMARY:Morning meeting
END:VEVENT
END:VCALENDAR
Expand Down Expand Up @@ -163,14 +163,14 @@ defmodule ICalendarTest do
VERSION:2.0
BEGIN:VEVENT
DESCRIPTION:Let's go see Star Wars.
DTEND;TZID=Etc/UTC:20151224T084500
DTSTART;TZID=Etc/UTC:20151224T083000
DTEND:20151224T084500
DTSTART:20151224T083000
SUMMARY:Film with Amy and Adam
END:VEVENT
BEGIN:VEVENT
DESCRIPTION:A big long meeting with lots of details.
DTEND;TZID=Etc/UTC:20151224T223000
DTSTART;TZID=Etc/UTC:20151224T190000
DTEND:20151224T223000
DTSTART:20151224T190000
SUMMARY:Morning meeting
END:VEVENT
END:VCALENDAR
Expand Down