Changeset 826


Ignore:
Timestamp:
12/29/2008 10:40:30 AM (6 years ago)
Author:
lowjoel
Message:

Fixed monthly schedules. Fixes #105, #106.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/Manager/Schedule.cs

    r605 r826  
    406406                    } 
    407407                    case ScheduleUnit.MONTHLY: 
     408                        //Step the number of months since the last run 
     409                        if (LastRun != DateTime.MinValue) 
     410                            nextRun = nextRun.AddMonths(frequency); 
     411 
     412                        //Ensure that the next run day is before the scheduled day of month 
     413                        while (monthlySchedule < nextRun.Day) 
     414                            nextRun = nextRun.AddDays(1); 
     415                         
    408416                        //Set the next run date to be the day on which the task will run. 
    409417                        nextRun = nextRun.AddDays(-((int)monthlySchedule - nextRun.Day)); 
    410418                        while (nextRun < DateTime.Now) 
    411                             nextRun = nextRun.AddMonths((int)frequency); 
     419                            nextRun = nextRun.AddMonths(frequency); 
    412420                        break; 
    413421                } 
Note: See TracChangeset for help on using the changeset viewer.