mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Task: Converted from ISO8601p to Duration
This commit is contained in:
parent
43d49d17d0
commit
12459e8c8b
1 changed files with 5 additions and 4 deletions
|
@ -41,6 +41,7 @@
|
||||||
#include <Context.h>
|
#include <Context.h>
|
||||||
#include <Pig.h>
|
#include <Pig.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <Duration.h>
|
||||||
#include <ISO8601.h>
|
#include <ISO8601.h>
|
||||||
#ifdef PRODUCT_TASKWARRIOR
|
#ifdef PRODUCT_TASKWARRIOR
|
||||||
#include <RX.h>
|
#include <RX.h>
|
||||||
|
@ -1544,9 +1545,9 @@ void Task::validate (bool applyDefault /* = true */)
|
||||||
{
|
{
|
||||||
if (context.columns["due"]->validate (Task::defaultDue))
|
if (context.columns["due"]->validate (Task::defaultDue))
|
||||||
{
|
{
|
||||||
ISO8601p dur (Task::defaultDue);
|
Duration dur (Task::defaultDue);
|
||||||
if ((time_t) dur != 0)
|
if (dur.toTime_t () != 0)
|
||||||
set ("due", (ISO8601d () + dur).toEpoch ());
|
set ("due", (ISO8601d () + dur.toTime_t ()).toEpoch ());
|
||||||
else
|
else
|
||||||
set ("due", ISO8601d (Task::defaultDue).toEpoch ());
|
set ("due", ISO8601d (Task::defaultDue).toEpoch ());
|
||||||
}
|
}
|
||||||
|
@ -1612,7 +1613,7 @@ void Task::validate (bool applyDefault /* = true */)
|
||||||
std::string value = get ("recur");
|
std::string value = get ("recur");
|
||||||
if (value != "")
|
if (value != "")
|
||||||
{
|
{
|
||||||
ISO8601p p;
|
Duration p;
|
||||||
std::string::size_type i = 0;
|
std::string::size_type i = 0;
|
||||||
if (! p.parse (value, i))
|
if (! p.parse (value, i))
|
||||||
throw format (STRING_TASK_VALID_RECUR, value);
|
throw format (STRING_TASK_VALID_RECUR, value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue