From 830b3e956278beb3c9c1dc66facd8fba45487fdd Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 12 Aug 2015 10:17:58 -0400 Subject: [PATCH] CmdEdit: Duration replaced by ISO8601p --- src/commands/CmdEdit.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 261086279..b432e364e 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -184,8 +184,8 @@ std::string CmdEdit::formatDuration ( std::string value = task.get (attribute); if (value.length ()) { - Duration dur (value); - value = dur.formatSeconds (); + ISO8601p dur (value); + value = dur.format (); } return value; @@ -546,9 +546,9 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string { if (value != "") { - Duration d; + ISO8601p p; std::string::size_type idx = 0; - if (d.parse (value, idx)) + if (p.parse (value, idx)) { context.footnote (STRING_EDIT_RECUR_MOD); if (task.get ("due") != "") @@ -686,7 +686,7 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string if ((task.get (col.first) != value) && (type != "date" || (task.get (col.first) != Date (value, dateformat).toEpochString ())) && (type != "duration" || - (task.get (col.first) != (std::string) Duration (value)))) + (task.get (col.first) != (std::string) ISO8601p (value)))) { if (value != "") { @@ -708,13 +708,11 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string } else if (type == "date") { - Date d (value, dateformat); - task.set (col.first, d.toEpochString ()); + task.set (col.first, Date (value, dateformat).toEpochString ()); } else if (type == "duration") { - Duration d (value); - task.set (col.first, (time_t) d); + task.set (col.first, (time_t) ISO8601p (value)); } } else