Mercurial > minori
annotate include/core/date.h @ 58:b7a1c0010ffd
sidebar: link view menu and sidebar together
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Thu, 28 Sep 2023 13:32:21 -0400 |
| parents | 75c804f713b2 |
| children | c69230dc2b5d |
| rev | line source |
|---|---|
| 9 | 1 #ifndef __core__date_h |
| 2 #define __core__date_h | |
| 3 #include "json.h" | |
| 4 #include <QDate> | |
| 5 #include <cstdint> | |
| 6 class Date { | |
| 7 public: | |
| 8 Date(); | |
| 51 | 9 Date(unsigned int y); |
| 10 Date(unsigned int y, unsigned int m, unsigned int d); | |
| 11 Date(const QDate& date); | |
|
47
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
9
diff
changeset
|
12 bool IsValid() const; |
| 51 | 13 void SetYear(unsigned int y); |
| 14 void SetMonth(unsigned int m); | |
| 15 void SetDay(unsigned int d); | |
| 9 | 16 void VoidYear(); |
| 17 void VoidMonth(); | |
| 18 void VoidDay(); | |
| 51 | 19 unsigned int GetYear() const; |
| 20 unsigned int GetMonth() const; | |
| 21 unsigned int GetDay() const; | |
| 9 | 22 QDate GetAsQDate() const; |
| 23 nlohmann::json GetAsAniListJson() const; | |
| 24 bool operator<(const Date& other) const; | |
| 25 bool operator>(const Date& other) const; | |
| 26 bool operator<=(const Date& other) const; | |
| 27 bool operator>=(const Date& other) const; | |
| 28 | |
| 29 private: | |
| 51 | 30 /* note: it might be worth it to change these all to int, as |
| 31 large bit precisions aren't exactly useful here... */ | |
| 32 std::shared_ptr<unsigned int> year; | |
| 33 std::shared_ptr<unsigned int> month; | |
| 34 std::shared_ptr<unsigned int> day; | |
| 9 | 35 }; |
| 36 #endif // __core__date_h |
