diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2014-02-19 18:02:22 +0000 |
---|---|---|
committer | CI bot <ps-jenkins@lists.canonical.com> | 2014-02-19 18:02:22 +0000 |
commit | 359764b5ea8926ae372844155b1394ebe06e3174 (patch) | |
tree | ae60e379a905cc017bc323e79cdc62d2d37c1177 /src/date-time.cpp | |
parent | 372b0a77f8840a35bb131ecf507313056170c403 (diff) | |
parent | 29ca2a552d7a7dcb6487c27ae4d036608aa68320 (diff) | |
download | ayatana-indicator-datetime-359764b5ea8926ae372844155b1394ebe06e3174.tar.gz ayatana-indicator-datetime-359764b5ea8926ae372844155b1394ebe06e3174.tar.bz2 ayatana-indicator-datetime-359764b5ea8926ae372844155b1394ebe06e3174.zip |
support for ubuntu-clock-app's alarms Fixes: 1233176, 1237752, 1255716
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 |