Website Summary Files Commits Branches @commit @diff @stats
path: root / src / DateTime / DateTime.cpp
diff options
context:
space:
mode:
Commit1a3226cf3ae0c986317a870401a2eba29a8129ad (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-01 08:40:37 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-01 08:40:37 +0300
Files2a0a7faf328541d5ef802cad9b658d2f4d6351d4 /src/DateTime/DateTime.cpp
FMI-OOP-P1_TicketSystem-1a3226cf3ae0c986317a870401a2eba29a8129ad.tar
FMI-OOP-P1_TicketSystem-1a3226cf3ae0c986317a870401a2eba29a8129ad.tar.gz
FMI-OOP-P1_TicketSystem-1a3226cf3ae0c986317a870401a2eba29a8129ad.zip
Parentcc4196fa77692b6588622c86ae7d152e7f21c645 (diff)
Autocommit at 01.05.2022 @ 08:40
1 files changed, 4 insertions, 2 deletions
-rw-r--r--src/DateTime/DateTime.cpp6
diff --git a/src/DateTime/DateTime.cpp b/src/DateTime/DateTime.cpp
index cb30268..544182c 100644
--- a/src/DateTime/DateTime.cpp
+++ b/src/DateTime/DateTime.cpp
@@ -6,6 +6,8 @@ DateTime::DateTime(unsigned char hour, unsigned char minute, unsigned char day,
this->year = year;
}
-DateTime::compare(const DateTime& other) {
-
+int DateTime::compare(const DateTime& other) {
+ if (year < other.year || month < other.month || day < other.day || hour < other.hour || minute < other.minute)
+ return -1;
+ return year > other.year && month > other.month && day > other.day && hour > other.hour && minute > other.minute;
}