aboutsummaryrefslogtreecommitdiff
path: root/include/datetime
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-03-16 21:07:54 +0100
committerCharles Kerr <charles.kerr@canonical.com>2015-03-16 21:07:54 +0100
commit273c3b3829c9a3e853d0b6b0a32ae87cc3c6852b (patch)
treee3c2859c54b0bba9c72ad221ea41c95ed8f5a70f /include/datetime
parent67510bd5a582762648a96d7b42024c4f181ece8e (diff)
downloadayatana-indicator-datetime-273c3b3829c9a3e853d0b6b0a32ae87cc3c6852b.tar.gz
ayatana-indicator-datetime-273c3b3829c9a3e853d0b6b0a32ae87cc3c6852b.tar.bz2
ayatana-indicator-datetime-273c3b3829c9a3e853d0b6b0a32ae87cc3c6852b.zip
add DateTime::end_of_month(), DateTime::end_of_day(). Add unit tests for them.
Diffstat (limited to 'include/datetime')
-rw-r--r--include/datetime/date-time.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/datetime/date-time.h b/include/datetime/date-time.h
index 8fa1569..7dfc207 100644
--- a/include/datetime/date-time.h
+++ b/include/datetime/date-time.h
@@ -36,17 +36,21 @@ class DateTime
{
public:
static DateTime NowLocal();
- static DateTime Local(int years, int months, int days, int hours, int minutes, int seconds);
+ static DateTime Local(int year, int month, int day, int hour, int minute, double seconds);
DateTime();
explicit DateTime(time_t t);
DateTime(GTimeZone* tz, GDateTime* dt);
+ DateTime(GTimeZone* tz, int year, int month, int day, int hour, int minute, double seconds);
DateTime& operator=(const DateTime& in);
DateTime to_timezone(const std::string& zone) const;
+ DateTime start_of_month() const;
DateTime start_of_day() const;
DateTime start_of_minute() const;
+ DateTime end_of_day() const;
+ DateTime end_of_month() const;
DateTime add_days(int days) const;
- DateTime add_full(int years, int months, int days, int hours, int minutes, double seconds) const;
+ DateTime add_full(int year, int month, int day, int hour, int minute, double seconds) const;
GDateTime* get() const;
GDateTime* operator()() const {return get();}