diff options
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/cfx_datetime.cpp | 6 | ||||
-rw-r--r-- | core/fxcrt/cfx_datetime.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_datetime.cpp b/core/fxcrt/cfx_datetime.cpp index dcf25d5463..833fe58907 100644 --- a/core/fxcrt/cfx_datetime.cpp +++ b/core/fxcrt/cfx_datetime.cpp @@ -127,3 +127,9 @@ int32_t CFX_DateTime::GetDayOfWeek() const { v += 7; return v; } + +bool CFX_DateTime::operator==(const CFX_DateTime& other) const { + return year_ == other.year_ && month_ == other.month_ && day_ == other.day_ && + hour_ == other.hour_ && minute_ == other.minute_ && + second_ == other.second_ && millisecond_ == other.millisecond_; +} diff --git a/core/fxcrt/cfx_datetime.h b/core/fxcrt/cfx_datetime.h index 2de75c4e38..272c2496cc 100644 --- a/core/fxcrt/cfx_datetime.h +++ b/core/fxcrt/cfx_datetime.h @@ -79,6 +79,8 @@ class CFX_DateTime { uint16_t GetMillisecond() const { return millisecond_; } int32_t GetDayOfWeek() const; + bool operator==(const CFX_DateTime& other) const; + private: int32_t year_; uint8_t month_; |