<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -779,8 +779,8 @@ class TodosController &lt; ApplicationController
     if todo.from_recurring_todo?
       recurring_todo = todo.recurring_todo
 
-      # check if there are active todos belonging to this recurring todo.
-      # only add new one if all active todos are completed
+      # check if there are active todos belonging to this recurring todo. only
+      # add new one if all active todos are completed
       if recurring_todo.todos.active.count == 0
       
         # check for next todo either from the due date or the show_from date
@@ -788,7 +788,7 @@ class TodosController &lt; ApplicationController
       
         # if both due and show_from are nil, check for a next todo from now
         date_to_check = Time.zone.now if date_to_check.nil?
-      
+
         if recurring_todo.active? &amp;&amp; recurring_todo.has_next_todo(date_to_check)
         
           # shift the reference date to yesterday if date_to_check is furher in
@@ -799,7 +799,7 @@ class TodosController &lt; ApplicationController
           # that new todos due for today will be created instead of new todos
           # for tomorrow.
           date = date_to_check.at_midnight &gt;= Time.zone.now.at_midnight ? date_to_check : Time.zone.now-1.day
-        
+
           new_recurring_todo = create_todo_from_recurring_todo(recurring_todo, date)
         end
       end</diff>
      <filename>app/controllers/todos_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -471,12 +471,23 @@ class RecurringTodo &lt; ActiveRecord::Base
     start = determine_start(previous)
     day = self.every_other1
     n = self.every_other2
-    
+
     case self.recurrence_selector
     when 0 # specific day of the month
-      if start.mday &gt;= day  
+      if start.mday &gt;= day
         # there is no next day n in this month, search in next month
-        start += n.months
+        #  
+        #  start += n.months
+        # 
+        # The above seems to not work. Fiddle with timezone. Looks like we hit a
+        # bug in rails here where 2008-12-01 +0100 plus 1.month becomes
+        # 2008-12-31 +0100. For now, just calculate in UTC and convert back to
+        # local timezone.
+        #  
+        #  TODO: recheck if future rails versions have this problem too
+        start = Time.utc(start.year, start.month, start.day)+n.months
+        start = Time.zone.local(start.year, start.month, start.day)
+
         # go back to day
       end
       return Time.zone.local(start.year, start.month, day)</diff>
      <filename>app/models/recurring_todo.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9147fb887cfd94d6ad50de2a4300458a215a9405</id>
    </parent>
  </parents>
  <author>
    <name>Reinier Balt</name>
    <email>lrbalt@gmail.com</email>
  </author>
  <url>http://github.com/bsag/tracks/commit/9d246f70cd515f3bea6774e72eda0c1424da2149</url>
  <id>9d246f70cd515f3bea6774e72eda0c1424da2149</id>
  <committed-date>2008-11-29T06:55:16-08:00</committed-date>
  <authored-date>2008-11-29T06:55:16-08:00</authored-date>
  <message>Fix #795.

Similar hack as http://github.com/bsag/tracks/commit/f43447e33f404f0d8e4a44f44bcf553289c5bf6a</message>
  <tree>151f45fb1afdb0c432d3be5f339136abd4e064f8</tree>
  <committer>
    <name>Reinier Balt</name>
    <email>lrbalt@gmail.com</email>
  </committer>
</commit>
