Skip to content

Commit d5a7c31

Browse files
committed
iCal spec defines UNTIL as either a date or date-time.
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
1 parent d870962 commit d5a7c31

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/ice_cube/parsers/ical_parser.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ def self.rule_from_ical(ical)
3737
when 'COUNT'
3838
params[:count] = value.to_i
3939
when 'UNTIL'
40-
params[:until] = Time.parse(value).utc
40+
params[:until] = if value =~ /^\d{8}$/
41+
Date.parse(value).to_datetime.to_time
42+
else
43+
Time.parse(value)
44+
end.utc
4145
when 'WKST'
4246
params[:wkst] = TimeUtil.ical_day_to_symbol(value)
4347
when 'BYSECOND'

0 commit comments

Comments
 (0)