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



1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
# File 'lib/when_exe/icalendar.rb', line 1664

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