mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-27 19:17:19 +02:00
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:
parent
5e0fc1caab
commit
ef1e889262
1 changed files with 3 additions and 4 deletions
|
@ -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 = " [1;37;43mMODIFICATION[0m ";
|
std::string label = " [1;37;43mMODIFICATION[0m ";
|
||||||
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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue