summaryrefslogtreecommitdiff
path: root/src/post.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-03-13 03:41:00 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-03-13 03:41:00 -0500
commitcfe8142b2b371dd40867e010b6b6c58fe864ba21 (patch)
treee5a024f8a61281db8225acb3576b0137e9ec9a83 /src/post.cc
parentcb317f9d395f44b2c2fc48f02869c3ed0f5ebcd0 (diff)
downloadfork-ledger-cfe8142b2b371dd40867e010b6b6c58fe864ba21.tar.gz
fork-ledger-cfe8142b2b371dd40867e010b6b6c58fe864ba21.tar.bz2
fork-ledger-cfe8142b2b371dd40867e010b6b6c58fe864ba21.zip
Access to checkin/checkout of timelog entries
Diffstat (limited to 'src/post.cc')
-rw-r--r--src/post.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/post.cc b/src/post.cc
index babb1292..d5e0d9bc 100644
--- a/src/post.cc
+++ b/src/post.cc
@@ -351,7 +351,14 @@ namespace {
return post.date();
}
value_t get_datetime(post_t& post) {
- return post.xdata().datetime;
+ return (! post.xdata().datetime.is_not_a_date_time() ?
+ post.xdata().datetime : datetime_t(post.date()));
+ }
+ value_t get_checkin(post_t& post) {
+ return post.checkin ? *post.checkin : NULL_VALUE;
+ }
+ value_t get_checkout(post_t& post) {
+ return post.checkout ? *post.checkout : NULL_VALUE;
}
template <value_t (*Func)(post_t&)>
@@ -444,6 +451,10 @@ expr_t::ptr_op_t post_t::lookup(const symbol_t::kind_t kind,
return WRAP_FUNCTOR(get_wrapper<&get_is_calculated>);
else if (name == "commodity")
return WRAP_FUNCTOR(&get_commodity);
+ else if (name == "checkin")
+ return WRAP_FUNCTOR(get_wrapper<&get_checkin>);
+ else if (name == "checkout")
+ return WRAP_FUNCTOR(get_wrapper<&get_checkout>);
break;
case 'd':