diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-02-05 18:09:49 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2014-02-05 18:09:49 -0600 |
commit | bf68bbe34cf8a8769345d1f36cc09cdc5d0ae07c (patch) | |
tree | 489206583514d4cf640c54d62458e98969a92001 /src/date-time.cpp | |
parent | dfd4f783102a0ca98b994fb80153e8accd3721ad (diff) | |
download | ayatana-indicator-datetime-bf68bbe34cf8a8769345d1f36cc09cdc5d0ae07c.tar.gz ayatana-indicator-datetime-bf68bbe34cf8a8769345d1f36cc09cdc5d0ae07c.tar.bz2 ayatana-indicator-datetime-bf68bbe34cf8a8769345d1f36cc09cdc5d0ae07c.zip |
another pass at removing alarms from the menu once they're no longer upcoming. This version fixes the header's icon as well.
Diffstat (limited to 'src/date-time.cpp')
-rw-r--r-- | src/date-time.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/date-time.cpp b/src/date-time.cpp index a634c5e..e6d99cd 100644 --- a/src/date-time.cpp +++ b/src/date-time.cpp @@ -69,6 +69,14 @@ DateTime DateTime::to_timezone(const std::string& zone) const return dt; } +DateTime DateTime::add_full(int years, int months, int days, int hours, int minutes, double seconds) const +{ + auto gdt = g_date_time_add_full(get(), years, months, days, hours, minutes, seconds); + DateTime dt(gdt); + g_date_time_unref(gdt); + return dt; +} + GDateTime* DateTime::get() const { g_assert(m_dt); @@ -88,6 +96,11 @@ int DateTime::day_of_month() const return g_date_time_get_day_of_month(get()); } +double DateTime::seconds() const +{ + return g_date_time_get_seconds(get()); +} + int64_t DateTime::to_unix() const { return g_date_time_to_unix(get()); @@ -112,6 +125,11 @@ bool DateTime::operator<(const DateTime& that) const return g_date_time_compare(get(), that.get()) < 0; } +bool DateTime::operator<=(const DateTime& that) const +{ + return g_date_time_compare(get(), that.get()) <= 0; +} + bool DateTime::operator!=(const DateTime& that) const { // return true if this isn't set, or if it's not equal |