Class: When::V::Event::Enumerator::Logic::Weekno

Inherits:
When::V::Event::Enumerator::Logic show all
Defined in:
lib/when_exe/icalendar.rb

Overview

BYWEEKNOを実装

Instance Attribute Summary

Attributes inherited from When::V::Event::Enumerator::Logic

#by_part, #cash, #freq_index, #list

Instance Method Summary collapse

Methods inherited from When::V::Event::Enumerator::Logic

#_candidates, #initialize

Constructor Details

This class inherits a constructor from When::V::Event::Enumerator::Logic

Instance Method Details

#_bound(seed, week_start) ⇒ Object



1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
# File 'lib/when_exe/icalendar.rb', line 1547

def _bound(seed, week_start)
  duration = week_start.duration
  center   = duration / 2
  # 1月4日を含む週
  return [seed.floor(When::YEAR, nil), seed.ceil(When::YEAR, nil)].map { |s|
    s += center
    bound  = s & week_start
    bound -= duration if (bound > s)
    bound
  }
end