Recurring Tasks - new "weekdays" frequency

- Added support for "weekdays" as a recurrence frequency, which skips
  Saturday and Sunday, but is otherwise a daily recurrence.  Thanks
  to Chris Pride.
This commit is contained in:
Paul Beckingham 2009-03-18 23:29:25 -04:00
parent 3c196230dd
commit 3d3d788961
8 changed files with 249 additions and 164 deletions

View file

@ -565,6 +565,18 @@ Date getNextRecurrence (Date& current, std::string& period)
return Date (m, d, y);
}
if (period == "weekdays")
{
int dow = current.dayOfWeek ();
int days;
if (dow == 5) days = 3;
else if (dow == 6) days = 2;
else days = 1;
return current + (days * 86400);
}
if (isdigit (period[0]) && period[period.length () - 1] == 'm')
{
std::string numeric = period.substr (0, period.length () - 1);