mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 00:57:19 +02:00
Task: Made better use of ::sameN methods
This commit is contained in:
parent
630a1530e0
commit
ed7097d5da
1 changed files with 3 additions and 6 deletions
|
@ -445,8 +445,7 @@ bool Task::is_dueweek () const
|
||||||
status != Task::deleted)
|
status != Task::deleted)
|
||||||
{
|
{
|
||||||
ISO8601d due (get_date ("due"));
|
ISO8601d due (get_date ("due"));
|
||||||
if (due >= ISO8601d ("socw") &&
|
if (due.sameWeek (ISO8601d ()))
|
||||||
due <= ISO8601d ("eocw"))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -465,8 +464,7 @@ bool Task::is_duemonth () const
|
||||||
status != Task::deleted)
|
status != Task::deleted)
|
||||||
{
|
{
|
||||||
ISO8601d due (get_date ("due"));
|
ISO8601d due (get_date ("due"));
|
||||||
if (due >= ISO8601d ("socm") &&
|
if (due.sameMonth (ISO8601d ()))
|
||||||
due <= ISO8601d ("eocm"))
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -503,9 +501,8 @@ bool Task::is_dueyear () const
|
||||||
if (status != Task::completed &&
|
if (status != Task::completed &&
|
||||||
status != Task::deleted)
|
status != Task::deleted)
|
||||||
{
|
{
|
||||||
ISO8601d now;
|
|
||||||
ISO8601d due (get_date ("due"));
|
ISO8601d due (get_date ("due"));
|
||||||
if (now.year () == due.year ())
|
if (due.sameYear (ISO8601d ()))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue