aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-03-16 18:22:33 +0100
committerCharles Kerr <charles.kerr@canonical.com>2015-03-16 18:22:33 +0100
commit67510bd5a582762648a96d7b42024c4f181ece8e (patch)
treede79e7cec8fe3e324cc815506404d00079629200
parent76c4567c8c674483e9e3b7286f78ab45115a8cf9 (diff)
downloadayatana-indicator-datetime-67510bd5a582762648a96d7b42024c4f181ece8e.tar.gz
ayatana-indicator-datetime-67510bd5a582762648a96d7b42024c4f181ece8e.tar.bz2
ayatana-indicator-datetime-67510bd5a582762648a96d7b42024c4f181ece8e.zip
in DateTime::is_set(), include timezone test
-rw-r--r--include/datetime/date-time.h2
-rw-r--r--src/date-time.cpp2
2 files changed, 1 insertions, 3 deletions
diff --git a/include/datetime/date-time.h b/include/datetime/date-time.h
index 6e73ff3..8fa1569 100644
--- a/include/datetime/date-time.h
+++ b/include/datetime/date-time.h
@@ -68,7 +68,7 @@ public:
static bool is_same_day(const DateTime& a, const DateTime& b);
static bool is_same_minute(const DateTime& a, const DateTime& b);
- bool is_set() const { return m_dt != nullptr; }
+ bool is_set() const { return m_tz && m_dt; }
private:
void reset(GTimeZone*, GDateTime*);
diff --git a/src/date-time.cpp b/src/date-time.cpp
index 47ca047..4176d06 100644
--- a/src/date-time.cpp
+++ b/src/date-time.cpp
@@ -88,7 +88,6 @@ DateTime DateTime::to_timezone(const std::string& zone) const
DateTime DateTime::start_of_day() const
{
g_assert(is_set());
- g_assert(m_tz.get() != nullptr);
int y=0, m=0, d=0;
ymd(y, m, d);
@@ -101,7 +100,6 @@ DateTime DateTime::start_of_day() const
DateTime DateTime::start_of_minute() const
{
g_assert(is_set());
- g_assert(m_tz.get() != nullptr);
int y=0, m=0, d=0;
ymd(y, m, d);