Enhancements - date

- Relocated valid.cpp/dataValid to Date::valid.
- Added new unit tests in date.t.cpp.
This commit is contained in:
Paul Beckingham 2009-06-13 12:51:51 -04:00
parent d99dec5556
commit 0665caae55
5 changed files with 23 additions and 16 deletions

View file

@ -152,18 +152,6 @@ void guess (
guess (type, options, candidate);
}
////////////////////////////////////////////////////////////////////////////////
bool validDate (std::string& date)
{
Date test (date, context.config.get ("dateformat", "m/d/Y"));
char epoch[16];
sprintf (epoch, "%d", (int) test.toEpoch ());
date = epoch;
return true;
}
////////////////////////////////////////////////////////////////////////////////
bool validPriority (const std::string& input)
{
@ -207,10 +195,10 @@ bool validAttribute (std::string& name, std::string& value)
guess ("color", colors, value);
else if (name == "due" && value != "")
validDate (value);
Date (value);
else if (name == "until" && value != "")
validDate (value);
Date (value);
else if (name == "priority")
{