mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
DOM
- Preserves more original types.
This commit is contained in:
parent
39c9f54d16
commit
4bf3364bb7
1 changed files with 9 additions and 1 deletions
10
src/DOM.cpp
10
src/DOM.cpp
|
@ -29,6 +29,7 @@
|
|||
#include <map>
|
||||
#include <stdlib.h>
|
||||
#include <Variant.h>
|
||||
#include <Duration.h>
|
||||
#include <Context.h>
|
||||
#include <Nibbler.h>
|
||||
#include <Date.h>
|
||||
|
@ -299,7 +300,14 @@ bool DOM::get (const std::string& name, const Task& task, Variant& value)
|
|||
{
|
||||
if (elements.size () == 2)
|
||||
{
|
||||
value = Variant (ref.get (canonical));
|
||||
Column* column = context.columns[canonical];
|
||||
if (column && column->type () == "date")
|
||||
value = Variant (ref.get_date (canonical), Variant::type_date);
|
||||
else if (column && column->type () == "duration")
|
||||
value = Variant ((time_t) Duration (ref.get (canonical)), Variant::type_duration);
|
||||
else
|
||||
value = Variant (ref.get (canonical));
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (elements.size () == 3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue