From ec66bc73d31787c86c448d9e7c36d4735fbcc23e Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 26 Sep 2015 15:04:01 -0400 Subject: [PATCH] ISO8601d: Added ::sameHour --- src/ISO8601.cpp | 9 +++++++++ src/ISO8601.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/ISO8601.cpp b/src/ISO8601.cpp index f899f481e..d8e3b4a97 100644 --- a/src/ISO8601.cpp +++ b/src/ISO8601.cpp @@ -1085,6 +1085,15 @@ bool ISO8601d::operator>= (const ISO8601d& rhs) const return _date >= rhs._date; } +//////////////////////////////////////////////////////////////////////////////// +bool ISO8601d::sameHour (const ISO8601d& rhs) const +{ + return this->year () == rhs.year () && + this->month () == rhs.month () && + this->day () == rhs.day () && + this->hour () == rhs.hour (); +} + //////////////////////////////////////////////////////////////////////////////// void ISO8601p::clear () { diff --git a/src/ISO8601.h b/src/ISO8601.h index 625d6dce2..951a9ae36 100644 --- a/src/ISO8601.h +++ b/src/ISO8601.h @@ -71,6 +71,7 @@ public: bool operator> (const ISO8601d&) const; bool operator<= (const ISO8601d&) const; bool operator>= (const ISO8601d&) const; + bool sameHour (const ISO8601d&) const; private: void clear ();