Enhancements - date
- Relocated valid.cpp/dataValid to Date::valid. - Added new unit tests in date.t.cpp.
This commit is contained in:
@@ -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")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user