Website Summary Files Commits Branches @commit @diff @stats
path: root / src
diff options
context:
space:
mode:
Commitfeb7de383da7dbff44cbc01c30752172394b9f3a (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-01 08:50:41 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-01 08:50:41 +0300
Files18b2e9c2a71f6f6c9d8540d4817525cefe2f31bd /src
FMI-OOP-P1_TicketSystem-feb7de383da7dbff44cbc01c30752172394b9f3a.tar
FMI-OOP-P1_TicketSystem-feb7de383da7dbff44cbc01c30752172394b9f3a.tar.gz
FMI-OOP-P1_TicketSystem-feb7de383da7dbff44cbc01c30752172394b9f3a.zip
Parentbdf33676953751811f382c9dfbd73d55bcdfc6c5 (diff)
Autocommit at 01.05.2022 @ 08:50
2 files changed, 44 insertions, 5 deletions
-rw-r--r--src/DateTime/DateTime.cpp39
-rw-r--r--src/DateTime/DateTime.h10
diff --git a/src/DateTime/DateTime.cpp b/src/DateTime/DateTime.cpp
index 448fefb..e8334a3 100644
--- a/src/DateTime/DateTime.cpp
+++ b/src/DateTime/DateTime.cpp
@@ -13,3 +13,42 @@ int DateTime::compare(const DateTime& other) {
return -1;
return year > other.year || month > other.month || day > other.day || hour > other.hour || minute > other.minute;
}
+
+
+unsigned short DateTime::get_hour() {
+ return hour;
+}
+bool DateTime::set_hour(unsigned short newHour) {
+ if (newHour > 23)
+ return false;
+ hour = newHour;
+ return true;
+}
+
+unsigned short DateTime::get_minute() {
+ return minute;
+}
+bool DateTime::set_minute(unsigned short newMinute) {
+ if (newMinute > 59)
+ return false;
+ minute = newMinute;
+ return true;
+}
+
+unsigned short DateTime::get_day() {
+ return day;
+}
+bool DateTime::set_day(unsigned short newDay) {
+
+}
+
+unsigned short get_month();
+bool set_month(unsigned short newMonth);
+
+unsigned short DateTime::get_year() {
+ return year;
+}
+bool DateTime::set_year(unsigned short newYear) {
+ year = newYear;
+ return true;
+}
diff --git a/src/DateTime/DateTime.h b/src/DateTime/DateTime.h
index 2327ca5..ff01d7b 100644
--- a/src/DateTime/DateTime.h
+++ b/src/DateTime/DateTime.h
@@ -13,15 +13,15 @@ public:
int compare(const DateTime& other);
unsigned short get_hour();
- unsigned short set_hour();
+ bool set_hour(unsigned short newHour);
unsigned short get_minute();
- unsigned short set_mintue();
+ bool set_minute(unsigned short newMinute);
unsigned short get_day();
- unsigned short set_day();
+ bool set_day(unsigned short newDay);
unsigned short get_month();
- unsigned short set_month();
+ bool set_month(unsigned short newMonth);
unsigned short get_year();
- unsigned short set_year();
+ bool set_year(unsigned short newYear);
};
#endif