diff --git a/src/Range.cpp b/src/Range.cpp index 8d7a6a4e..9b5f89b4 100644 --- a/src/Range.cpp +++ b/src/Range.cpp @@ -47,6 +47,13 @@ bool Range::operator== (const Range& other) const end == other.end; } +//////////////////////////////////////////////////////////////////////////////// +bool Range::open () const +{ + return start.toEpoch () > 0 && + end.toEpoch () == 0; +} + //////////////////////////////////////////////////////////////////////////////// bool Range::started () const { diff --git a/src/Range.h b/src/Range.h index ae640a26..d8c77c27 100644 --- a/src/Range.h +++ b/src/Range.h @@ -37,6 +37,7 @@ public: Range (const Datetime&, const Datetime&); bool operator== (const Range&) const; + bool open () const; bool started () const; bool ended () const; bool overlap (const Range&) const;