Skip to content

Commit

Permalink
iCal spec defines UNTIL as either a date or date-time.
Browse files Browse the repository at this point in the history
Support for rules with UNTIL part set as a date, avoiding coercion into
a Time in the system time zone.

https://tools.ietf.org/html/rfc5545#section-3.3.10
  • Loading branch information
alexdilley committed Jun 20, 2016
1 parent d870962 commit d4c611e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ice_cube/parsers/ical_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ def self.rule_from_ical(ical)
when 'COUNT'
params[:count] = value.to_i
when 'UNTIL'
params[:until] = Time.parse(value).utc
params[:until] = if value =~ /^\d{8}$/
Date.parse(value).to_datetime
else
Time.parse(value)
end.utc
when 'WKST'
params[:wkst] = TimeUtil.ical_day_to_symbol(value)
when 'BYSECOND'
Expand Down

0 comments on commit d4c611e

Please sign in to comment.