summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-09-17 05:06:17 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-09-17 05:06:17 -0400
commita68bcfc92ed64a449925cd451b12afc45dbe9d28 (patch)
treedb21f1282e323551e750b71719a6326737a8bcf4
parenta00af44d1dfe14b2a2b545cb3b8dc2e44697da6f (diff)
downloadledger-a68bcfc92ed64a449925cd451b12afc45dbe9d28.tar.gz
ledger-a68bcfc92ed64a449925cd451b12afc45dbe9d28.tar.bz2
ledger-a68bcfc92ed64a449925cd451b12afc45dbe9d28.zip
Permit date_t to be constructed by a datetime_t.
-rw-r--r--datetime.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/datetime.h b/datetime.h
index c057c76b..377f7f00 100644
--- a/datetime.h
+++ b/datetime.h
@@ -17,8 +17,6 @@ class datetime_t;
class date_t
{
- date_t(const datetime_t& _when);
-
public:
static date_t now;
static const char * formats[];
@@ -30,7 +28,7 @@ class date_t
date_t() : when(0) {}
date_t(const date_t& _when) : when(_when.when) {}
-
+ date_t(const datetime_t& _when);
date_t(const std::time_t _when) : when(_when) {
#if 0
struct std::tm * moment = std::localtime(&_when);
@@ -299,7 +297,6 @@ inline date_t& date_t::operator+=(const interval_t& period) {
}
inline date_t::date_t(const datetime_t& _when) {
- assert(0);
struct std::tm * moment = _when.localtime();
moment->tm_hour = 0;
moment->tm_min = 0;