mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Variant
- Can now convert type_string to type_date via legacy dateformat, provided that Context transmits the format.
This commit is contained in:
parent
f585f31d69
commit
52eaf3f9c2
4 changed files with 17 additions and 2 deletions
|
@ -31,10 +31,13 @@
|
|||
#include <stdlib.h>
|
||||
#include <Variant.h>
|
||||
#include <ISO8601.h>
|
||||
#include <Date.h>
|
||||
#include <Duration.h>
|
||||
#include <RX.h>
|
||||
#include <text.h>
|
||||
|
||||
std::string Variant::dateFormat = "";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Variant::Variant ()
|
||||
: _type (type_unknown)
|
||||
|
@ -1590,6 +1593,12 @@ void Variant::cast (const enum type new_type)
|
|||
{
|
||||
_date = (time_t) iso;
|
||||
}
|
||||
// Support legacy date formats.
|
||||
else if (dateFormat != "")
|
||||
{
|
||||
Date d (_string, dateFormat);
|
||||
_date = d.toEpoch ();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case type_duration:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue