From 39997e2ab1e986fbfd4ea5c084222ed212dc30cf Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sun, 18 Apr 2021 13:43:38 +0430 Subject: [PATCH] LibCore: Implement operator less-than for Core::DateTime that just compares their timestamps. --- Userland/Libraries/LibCore/DateTime.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibCore/DateTime.h b/Userland/Libraries/LibCore/DateTime.h index 1702914bcc..59b08758ae 100644 --- a/Userland/Libraries/LibCore/DateTime.h +++ b/Userland/Libraries/LibCore/DateTime.h @@ -59,6 +59,7 @@ public: // FIXME: This should be replaced with a proper comparison // operator when we get the equivalent of strptime bool is_before(const String&) const; + bool operator<(const DateTime& other) const { return m_timestamp < other.m_timestamp; } private: time_t m_timestamp { 0 };