Mercurial > minori
annotate include/core/date.h @ 47:d8eb763e6661
information.cpp: add widgets to the list tab, and add an
"optional date" widget like taiga has so users can specify whether to
set the date or not
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Mon, 25 Sep 2023 00:43:38 -0400 |
| parents | 5c0397762b53 |
| children | 75c804f713b2 |
| 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(); | |
| 9 Date(int32_t y); | |
| 10 Date(int32_t y, int8_t m, int8_t d); | |
|
47
d8eb763e6661
information.cpp: add widgets to the list tab, and add an
Paper <mrpapersonic@gmail.com>
parents:
9
diff
changeset
|
11 bool IsValid() const; |
| 9 | 12 void SetYear(int32_t y); |
| 13 void SetMonth(int8_t m); | |
| 14 void SetDay(int8_t d); | |
| 15 void VoidYear(); | |
| 16 void VoidMonth(); | |
| 17 void VoidDay(); | |
| 18 int32_t GetYear() const; | |
| 19 int8_t GetMonth() const; | |
| 20 int8_t GetDay() const; | |
| 21 QDate GetAsQDate() const; | |
| 22 nlohmann::json GetAsAniListJson() const; | |
| 23 bool operator<(const Date& other) const; | |
| 24 bool operator>(const Date& other) const; | |
| 25 bool operator<=(const Date& other) const; | |
| 26 bool operator>=(const Date& other) const; | |
| 27 | |
| 28 private: | |
| 29 std::shared_ptr<int32_t> year; | |
| 30 std::shared_ptr<int8_t> month; | |
| 31 std::shared_ptr<int8_t> day; | |
| 32 }; | |
| 33 #endif // __core__date_h |
