Skip to content

Commit

Permalink
285: Pass interval id to extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Hertenstein committed Feb 16, 2020
1 parent 35a38d6 commit 7db941a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Interval.cpp
Expand Up @@ -99,16 +99,14 @@ std::string Interval::serialize () const
std::string Interval::json () const
{
std::stringstream out;
out << '{';
out << "{\"id\":" << id;

if (is_started ())
out << "\"start\":\"" << start.toISO () << "\"";
if (is_started ()) {
out << ",\"start\":\"" << start.toISO () << "\"";
}

if (is_ended ())
{
if (is_started ())
out << ',';
out << "\"end\":\"" << end.toISO () << "\"";
if (is_ended ()) {
out << ",\"end\":\"" << end.toISO () << "\"";
}

if (! _tags.empty ())
Expand Down

0 comments on commit 7db941a

Please sign in to comment.