Patch - Configurable week start day.

- Added ChangeLog entry.
- Modified timesheet report error message on incorrect weekstart
  value to match that of calendar.
This commit is contained in:
Paul Beckingham 2009-05-24 20:28:07 -04:00
parent d09630a3a0
commit 020604334e
3 changed files with 10 additions and 5 deletions

View file

@ -1347,10 +1347,10 @@ std::string handleReportTimesheet (TDB& tdb, T& task, Config& conf)
filter (tasks, task);
// What day of the week does the user consider the first?
int weekStart = Date::dayOfWeek (conf.get ("weekstart", "Monday"));
if (weekStart == -1)
throw std::string ("The 'weekstart' configuration variable does "
"not contain a day name, such as 'Monday'.");
int weekStart = Date::dayOfWeek (conf.get ("weekstart", "Sunday"));
if (weekStart != 0 && weekStart != 1)
throw std::string ("The 'weekstart' configuration variable may "
"only contain 'Sunday' or 'Monday'.");
// Determine the date of the first day of the most recent report.
Date today;
@ -1540,8 +1540,9 @@ std::string renderMonths (
Table table;
table.setDateFormat (conf.get ("dateformat", "m/d/Y"));
// What day of the week does the user consider the first?
int weekStart = Date::dayOfWeek (conf.get ("weekstart", "Sunday"));
if ((weekStart != 0) && (weekStart != 1))
if (weekStart != 0 && weekStart != 1)
throw std::string ("The 'weekstart' configuration variable may "
"only contain 'Sunday' or 'Monday'.");