DateTime GetRuntimeForDaily(DateTime now, DailySchedule schedule) { var @ref = new DateTime(now.Year, now.Month, now.Day).AddDays((now.DayOfYear-1)%schedule.Every); @ref = @ref.AddMinutes(schedule.RunAt.Hour*60 + schedule.RunAt.Minute); if (@ref < now) @ref = @ref.AddDays(schedule.Every); return @ref; }
public JobSchedule() { ScheduleType = JobScheduleType.Weekly; Daily = new DailySchedule(); Weekly = new WeeklySchedule(); Monthly = new MonthlySchedule(); }