mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 10:07:19 +02:00
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:
parent
d09630a3a0
commit
020604334e
3 changed files with 10 additions and 5 deletions
|
@ -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'.");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue