TDB2: Migrated from ISO8601d to Datetime

This commit is contained in:
Paul Beckingham 2016-12-17 21:22:31 -05:00
parent 29300ea9e1
commit 4c8456a86d

View file

@ -35,7 +35,7 @@
#include <signal.h> #include <signal.h>
#include <Context.h> #include <Context.h>
#include <Color.h> #include <Color.h>
#include <ISO8601.h> #include <Datetime.h>
#include <i18n.h> #include <i18n.h>
#include <Table.h> #include <Table.h>
#include <shared.h> #include <shared.h>
@ -348,7 +348,7 @@ Task TF2::load_task (const std::string& line)
// or needs to be 'woken'. // or needs to be 'woken'.
void TF2::load_gc (Task& task) void TF2::load_gc (Task& task)
{ {
ISO8601d now; Datetime now;
std::string status = task.get ("status"); std::string status = task.get ("status");
if (status == "pending" || if (status == "pending" ||
@ -358,7 +358,7 @@ void TF2::load_gc (Task& task)
} }
else if (status == "waiting") else if (status == "waiting")
{ {
ISO8601d wait (task.get_date ("wait")); Datetime wait (task.get_date ("wait"));
if (wait < now) if (wait < now)
{ {
task.set ("status", "pending"); task.set ("status", "pending");
@ -709,7 +709,7 @@ void TDB2::update (
// old <task> // old <task>
// new <task> // new <task>
// --- // ---
undo.add_line ("time " + ISO8601d ().toEpochString () + '\n'); undo.add_line ("time " + Datetime ().toEpochString () + '\n');
undo.add_line ("old " + original.composeF4 () + '\n'); undo.add_line ("old " + original.composeF4 () + '\n');
undo.add_line ("new " + task.composeF4 () + '\n'); undo.add_line ("new " + task.composeF4 () + '\n');
undo.add_line ("---\n"); undo.add_line ("---\n");
@ -728,7 +728,7 @@ void TDB2::update (
// time <time> // time <time>
// new <task> // new <task>
// --- // ---
undo.add_line ("time " + ISO8601d ().toEpochString () + '\n'); undo.add_line ("time " + Datetime ().toEpochString () + '\n');
undo.add_line ("new " + task.composeF4 () + '\n'); undo.add_line ("new " + task.composeF4 () + '\n');
undo.add_line ("---\n"); undo.add_line ("---\n");
} }
@ -1030,7 +1030,7 @@ void TDB2::show_diff (
const std::string& prior, const std::string& prior,
const std::string& when) const std::string& when)
{ {
ISO8601d lastChange (strtol (when.c_str (), NULL, 10)); Datetime lastChange (strtol (when.c_str (), NULL, 10));
// Set the colors. // Set the colors.
Color color_red (context.color () ? context.config.get ("color.undo.before") : ""); Color color_red (context.color () ? context.config.get ("color.undo.before") : "");