- TW-1471 task calc uses output it doesn't understand (thanks to Jens Erat).
This commit is contained in:
Paul Beckingham 2014-12-14 18:34:12 -05:00
parent 63dcea9c37
commit d01d2109cf
3 changed files with 11 additions and 12 deletions

View file

@ -2062,21 +2062,19 @@ void Variant::cast (const enum type new_type)
case type_date:
{
_date = 0;
if (dateFormat != "")
ISO8601d iso;
std::string::size_type pos = 0;
if (iso.parse (_string, pos) &&
pos == _string.length ())
{
_date = (time_t) iso;
}
else if (dateFormat != "")
{
Date d (_string, dateFormat);
_date = d.toEpoch ();
}
else
{
ISO8601d iso;
std::string::size_type pos = 0;
if (iso.parse (_string, pos) &&
pos == _string.length ())
{
_date = (time_t) iso;
}
}
}
break;
case type_duration: