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
|
@ -6,6 +6,8 @@
|
||||||
+ Fixed bug that cause the _forcecolor configuration variable to be
|
+ Fixed bug that cause the _forcecolor configuration variable to be
|
||||||
considered obsolete (thank to Bruce Dillahunty).
|
considered obsolete (thank to Bruce Dillahunty).
|
||||||
+ Fixed documentation errors (thanks to Thomas@BIC).
|
+ Fixed documentation errors (thanks to Thomas@BIC).
|
||||||
|
+ The 'weekstart' configuration variable now controls the 'calendar'
|
||||||
|
command (thanks to Federico Hernandez).
|
||||||
|
|
||||||
------ old releases ------------------------------
|
------ old releases ------------------------------
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,8 @@
|
||||||
<li>Fixed bug that cause the _forcecolor configuration variable to be
|
<li>Fixed bug that cause the _forcecolor configuration variable to be
|
||||||
considered obsolete (thank to Bruce Dillahunty).
|
considered obsolete (thank to Bruce Dillahunty).
|
||||||
<li>Fixed documentation errors (thanks to Thomas@BIC).
|
<li>Fixed documentation errors (thanks to Thomas@BIC).
|
||||||
|
<li>The 'weekstart' configuration variable now controls the 'calendar'
|
||||||
|
command (thanks to Federico Hernandez).
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -1347,10 +1347,10 @@ std::string handleReportTimesheet (TDB& tdb, T& task, Config& conf)
|
||||||
filter (tasks, task);
|
filter (tasks, task);
|
||||||
|
|
||||||
// What day of the week does the user consider the first?
|
// What day of the week does the user consider the first?
|
||||||
int weekStart = Date::dayOfWeek (conf.get ("weekstart", "Monday"));
|
int weekStart = Date::dayOfWeek (conf.get ("weekstart", "Sunday"));
|
||||||
if (weekStart == -1)
|
if (weekStart != 0 && weekStart != 1)
|
||||||
throw std::string ("The 'weekstart' configuration variable does "
|
throw std::string ("The 'weekstart' configuration variable may "
|
||||||
"not contain a day name, such as 'Monday'.");
|
"only contain 'Sunday' or 'Monday'.");
|
||||||
|
|
||||||
// Determine the date of the first day of the most recent report.
|
// Determine the date of the first day of the most recent report.
|
||||||
Date today;
|
Date today;
|
||||||
|
@ -1540,8 +1540,9 @@ std::string renderMonths (
|
||||||
Table table;
|
Table table;
|
||||||
table.setDateFormat (conf.get ("dateformat", "m/d/Y"));
|
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"));
|
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 "
|
throw std::string ("The 'weekstart' configuration variable may "
|
||||||
"only contain 'Sunday' or 'Monday'.");
|
"only contain 'Sunday' or 'Monday'.");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue