1 class Chronic::RepeaterDay < Chronic::Repeater #:nodoc:
2 DAY_SECONDS = 86_400 # (24 * 60 * 60)
8 @current_day_start = Time.local(@now.year, @now.month, @now.day)
11 direction = pointer == :future ? 1 : -1
12 @current_day_start += direction * DAY_SECONDS
14 Chronic::Span.new(@current_day_start, @current_day_start + DAY_SECONDS)
17 def this(pointer = :future)
22 day_begin = Time.construct(@now.year, @now.month, @now.day, @now.hour + 1)
23 day_end = Time.construct(@now.year, @now.month, @now.day) + DAY_SECONDS
25 day_begin = Time.construct(@now.year, @now.month, @now.day)
26 day_end = Time.construct(@now.year, @now.month, @now.day, @now.hour)
28 day_begin = Time.construct(@now.year, @now.month, @now.day)
29 day_end = Time.construct(@now.year, @now.month, @now.day) + DAY_SECONDS
32 Chronic::Span.new(day_begin, day_end)
35 def offset(span, amount, pointer)
36 direction = pointer == :future ? 1 : -1
37 span + direction * amount * DAY_SECONDS