mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
TW-1491 - TW-1491 Regression in deleting due dates
This commit is contained in:
parent
5a3037f257
commit
cd31335742
1 changed files with 9 additions and 12 deletions
21
src/Task.cpp
21
src/Task.cpp
|
@ -636,8 +636,9 @@ void Task::parseJSON (const std::string& line)
|
||||||
// Dates are converted from ISO to epoch.
|
// Dates are converted from ISO to epoch.
|
||||||
else if (type == "date")
|
else if (type == "date")
|
||||||
{
|
{
|
||||||
Date d (unquoteText (i->second->dump ()));
|
std::string text = unquoteText (i->second->dump ());
|
||||||
set (i->first, d.toEpochString ());
|
Date d (text);
|
||||||
|
set (i->first, text == "" ? "" : d.toEpochString ());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tags are an array of JSON strings.
|
// Tags are an array of JSON strings.
|
||||||
|
@ -815,16 +816,12 @@ std::string Task::composeJSON (bool decorate /*= false*/) const
|
||||||
if (type == "date")
|
if (type == "date")
|
||||||
{
|
{
|
||||||
Date d (i->second);
|
Date d (i->second);
|
||||||
if (i->first == "modification")
|
out << "\""
|
||||||
out << "\"modified\":\""
|
<< (i->first == "modification" ? "modified" : i->first)
|
||||||
<< d.toISO ()
|
<< "\":\""
|
||||||
<< "\"";
|
// Date was deleted, do not export parsed empty string
|
||||||
else
|
<< (i->second == "" ? "" : d.toISO ())
|
||||||
out << "\""
|
<< "\"";
|
||||||
<< i->first
|
|
||||||
<< "\":\""
|
|
||||||
<< d.toISO ()
|
|
||||||
<< "\"";
|
|
||||||
|
|
||||||
++attributes_written;
|
++attributes_written;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue