mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-30 05:48:50 +01:00
fix regression in recurring todos
This commit is contained in:
parent
a31c0a7a5d
commit
62bc47b26b
2 changed files with 2 additions and 5 deletions
|
|
@ -489,7 +489,7 @@ class RecurringTodo < ActiveRecord::Base
|
|||
|
||||
case self.recurrence_selector
|
||||
when 0 # specific day of the month
|
||||
if start.mday >= day
|
||||
if (previous && start.mday >= day) || (previous.nil? && start.mday > day)
|
||||
# there is no next day n in this month, search in next month
|
||||
#
|
||||
# start += n.months
|
||||
|
|
|
|||
|
|
@ -175,9 +175,6 @@ class RecurringTodoTest < ActiveSupport::TestCase
|
|||
assert_equal @sunday, due_date # june 8th
|
||||
|
||||
due_date = @monthly.get_due_date(@sunday) # june 8th
|
||||
assert_equal Time.zone.local(2008,6,8), due_date # june 8th
|
||||
|
||||
due_date = @monthly.get_due_date(@monday) # june 9th
|
||||
assert_equal Time.zone.local(2008,8,8), due_date # aug 8th
|
||||
end
|
||||
|
||||
|
|
@ -247,7 +244,7 @@ class RecurringTodoTest < ActiveSupport::TestCase
|
|||
# every_day should return start_day if it is in the future
|
||||
@every_day.start_from = @in_three_days
|
||||
due_date = @every_day.get_due_date(nil)
|
||||
assert_equal @in_three_days, due_date
|
||||
assert_equal @in_three_days.to_s(:db), due_date.to_s(:db)
|
||||
due_date = @every_day.get_due_date(@tomorrow)
|
||||
assert_equal @in_three_days, due_date
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue