Enhancement - #390 timestamps in annotations

- added new dateformat for annotations
- documented prev. added format modifiers H, N and S
This commit is contained in:
Federico Hernandez
2010-06-04 00:57:42 +02:00
parent 2bfd220714
commit 70e6f4f9f6
7 changed files with 68 additions and 25 deletions

View File

@@ -164,13 +164,12 @@ static std::string formatTask (Task task)
foreach (anno, annotations)
{
Date dt (::atoi (anno->name ().substr (11).c_str ()));
before << " Annotation: " << dt.toString (context.config.get ("dateformat"))
before << " Annotation: " << dt.toString (context.config.get ("dateformat.annotation"))
<< " " << anno->value () << std::endl;
}
Date now;
before << " Annotation: " << now.toString (context.config.get ("dateformat")) << " " << std::endl
<< " Annotation: " << now.toString (context.config.get ("dateformat")) << " " << std::endl
before << " Annotation: " << now.toString (context.config.get ("dateformat.annotation")) << " " << std::endl
<< "# End" << std::endl;
return before.str ();
@@ -503,7 +502,7 @@ static void parseTask (Task& task, const std::string& after)
std::string::size_type gap = value.find (" ");
if (gap != std::string::npos)
{
Date when (value.substr (0, gap), context.config.get ("dateformat"));
Date when (value.substr (0, gap), context.config.get ("dateformat.annotation"));
// This guarantees that if more than one annotation has the same date,
// that the seconds will be different, thus unique, thus not squashed.