Enhancement

- Implemented Record::get_date to eliminated the need to obtain a date
  as a string, then convert to time_t, then instantiate a Date.
This commit is contained in:
Paul Beckingham 2011-07-01 22:13:34 -04:00
parent 7d5f4fdfc7
commit 63f91c2f88
12 changed files with 54 additions and 42 deletions

View file

@ -117,7 +117,7 @@ int CmdTimesheet::execute (std::string& output)
// If task completed within range.
if (task->getStatus () == Task::completed)
{
Date compDate (strtol (task->get ("end").c_str (), NULL, 10));
Date compDate (task->get_date ("end"));
if (compDate >= start && compDate < end)
{
Color c (task->get ("fg") + " " + task->get ("bg"));
@ -155,7 +155,7 @@ int CmdTimesheet::execute (std::string& output)
if (task->getStatus () == Task::pending &&
task->has ("start"))
{
Date startDate (strtol (task->get ("start").c_str (), NULL, 10));
Date startDate (task->get_date ("start"));
if (startDate >= start && startDate < end)
{
Color c (task->get ("fg") + " " + task->get ("bg"));