From cd837a006c6aa3fc3f71f1f7ce2a56fa638da1d5 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 3 Jun 2014 00:42:21 -0400 Subject: [PATCH] Task - ::modify was not casting strings to dates for date types. --- src/Context.cpp | 10 +++------- src/Task.cpp | 1 + 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Context.cpp b/src/Context.cpp index 9d7028e28..215ae44ff 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -195,14 +195,10 @@ int Context::initialize (int argc, const char** argv) parser.findIdSequence (); // parser.injectDefaults (); // rc.default.command - // Static initialization to decouple code. - staticInitialization (); + staticInitialization (); // Decouple code from Context. + parser.parse (); // Parse all elements. - // Parse the command line. - parser.parse (); - - // Initialize the database. - tdb2.set_location (data_dir); + tdb2.set_location (data_dir); // Prepare the task database. // First opportunity to run a hook script. hooks.initialize (); diff --git a/src/Task.cpp b/src/Task.cpp index cb56937c8..14475ea77 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -2038,6 +2038,7 @@ void Task::modify (modType type, bool text_required /* = false */) } else { + v.cast (Variant::type_date); context.debug (label + name + " <-- " + format ("{1}", v.get_date ()) + " <-- " + (std::string) v + " <-- " + value); }