ColTypeDate: Do not explicitly add now to relative dates

Relative dates are now implicitly anchored around now datetime point
during casting, hence there is no reason to do this anymore.
This commit is contained in:
Tomas Babej 2021-01-18 02:20:13 -05:00
parent 5e0fc1caab
commit ef1e889262

View file

@ -222,14 +222,13 @@ void ColumnTypeDate::modify (Task& task, const std::string& value)
evaluatedValue = Variant (value); evaluatedValue = Variant (value);
} }
// If v is duration, add 'now' to it, else store as date. // If v is duration, we need to convert it to date (and implicitly add now),
// else store as date.
std::string label = " MODIFICATION "; std::string label = " MODIFICATION ";
if (evaluatedValue.type () == Variant::type_duration) if (evaluatedValue.type () == Variant::type_duration)
{ {
Context::getContext ().debug (label + _name + " <-- '" + format ("{1}", format (evaluatedValue.get_duration ())) + "' <-- '" + (std::string) evaluatedValue + "' <-- '" + value + '\''); Context::getContext ().debug (label + _name + " <-- '" + format ("{1}", format (evaluatedValue.get_duration ())) + "' <-- '" + (std::string) evaluatedValue + "' <-- '" + value + '\'');
Datetime date_now; evaluatedValue.cast (Variant::type_date);
Variant now (date_now.toEpoch (), Variant::type_date);
evaluatedValue += now;
} }
else else
{ {