lib/when_exe/region/world.rb in when_exe-0.3.2 vs lib/when_exe/region/world.rb in when_exe-0.3.3
- old
+ new
@@ -109,10 +109,10 @@
7.times do |k|
name = When.CalendarNote('WorldWeek/NoteObjects::day::Week')[k].to_s.downcase
module_eval %Q{
def #{name}(date, parameter=nil)
event_name = 'from_#{name}'
- date = When.Calendar('World').jul_trans(date, {:events=>[event_name]})
+ date = When.Calendar('World').jul_trans(date, {:events=>[event_name], :precision=>When::DAY})
y,m,d = date.cal_date
dow = (m % 6 == 0 && d == 31) ? 7-#{k} : ([4,6,2][m % 3] + d - #{k}) % 7
return date if dow == 0
dow += 1 if d <= dow && (m == 1 || m == 7 && When.Calendar('World')._sum([y]) == 366)
date += When::TM::PeriodDuration.new([0,0,-dow])