<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -508,7 +508,13 @@ class RecurringTodo &lt; ActiveRecord::Base
     if previous.nil?
       start = self.start_from.nil? ? Time.now.utc : self.start_from
     else
-      start = previous
+      if self.start_from.nil?
+        start = previous
+      else
+        # check if the start_from date is later than previous. If so, use
+        # start_from as start to search for next date
+        start = self.start_from &gt; previous ? self.start_from : previous
+      end
     end
 
     day = self.every_other1</diff>
      <filename>app/models/recurring_todo.rb</filename>
    </modified>
    <modified>
      <diff>@@ -203,6 +203,13 @@ class RecurringTodoTest &lt; Test::Rails::TestCase
     due_date1 = @yearly.get_due_date(nil) 
     due_date2 = @yearly.get_due_date(Time.now.utc + 1.day)
     assert_equal due_date1, due_date2
+  end
+
+  def test_start_from_in_future
+    # start from after june 8th 2008
+    @yearly.start_from = Time.utc(2008,6,12)
+    assert_equal Time.utc(2009,6,8), @yearly.get_due_date(nil) # jun 8th next year
+    assert_equal Time.utc(2009,6,8), @yearly.get_due_date(Time.utc(2008,6,1)) # also next year
     
     this_year = Time.now.utc.year
     @yearly.start_from = Time.utc(this_year+1,6,12)</diff>
      <filename>test/unit/recurring_todo_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>666f524b16c847cf8b3d241636e57087097306dc</id>
    </parent>
  </parents>
  <author>
    <name>Reinier Balt</name>
    <email>lrbalt@gmail.com</email>
  </author>
  <url>http://github.com/bsag/tracks/commit/f4378ffde1b2364bbcbf999191a76f580fa02904</url>
  <id>f4378ffde1b2364bbcbf999191a76f580fa02904</id>
  <committed-date>2008-08-19T12:25:25-07:00</committed-date>
  <authored-date>2008-08-19T12:25:25-07:00</authored-date>
  <message>fix case where future start_from was ignored for yearly recurrence patterns</message>
  <tree>77fd8941fabe8f4ac53ac5b6309244f5ca5d1515</tree>
  <committer>
    <name>Reinier Balt</name>
    <email>lrbalt@gmail.com</email>
  </committer>
</commit>
