mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
TW-1471
- TW-1471 task calc uses output it doesn't understand (thanks to Jens Erat).
This commit is contained in:
parent
63dcea9c37
commit
d01d2109cf
3 changed files with 11 additions and 12 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue