Mercurial > minori
annotate include/core/date.h @ 101:c537996cf67b
*: multitude of config changes
1. theme is now configurable from the settings menu
(but you have to restart for it to apply)
2. config is now stored in an INI file, with no method of
conversion from json (this repo is private-ish anyway)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Fri, 03 Nov 2023 14:06:02 -0400 |
parents | c69230dc2b5d |
children | f88eda79c60a |
rev | line source |
---|---|
9 | 1 #ifndef __core__date_h |
2 #define __core__date_h | |
85 | 3 |
9 | 4 #include "json.h" |
5 #include <QDate> | |
6 #include <cstdint> | |
85 | 7 |
9 | 8 class Date { |
9 public: | |
10 Date(); | |
51 | 11 Date(unsigned int y); |
12 Date(unsigned int y, unsigned int m, unsigned int d); | |
13 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
|
14 bool IsValid() const; |
51 | 15 void SetYear(unsigned int y); |
16 void SetMonth(unsigned int m); | |
17 void SetDay(unsigned int d); | |
9 | 18 void VoidYear(); |
19 void VoidMonth(); | |
20 void VoidDay(); | |
51 | 21 unsigned int GetYear() const; |
22 unsigned int GetMonth() const; | |
23 unsigned int GetDay() const; | |
9 | 24 QDate GetAsQDate() const; |
25 nlohmann::json GetAsAniListJson() const; | |
26 bool operator<(const Date& other) const; | |
27 bool operator>(const Date& other) const; | |
28 bool operator<=(const Date& other) const; | |
29 bool operator>=(const Date& other) const; | |
30 | |
31 private: | |
51 | 32 /* note: it might be worth it to change these all to int, as |
33 large bit precisions aren't exactly useful here... */ | |
34 std::shared_ptr<unsigned int> year; | |
35 std::shared_ptr<unsigned int> month; | |
36 std::shared_ptr<unsigned int> day; | |
9 | 37 }; |
85 | 38 |
9 | 39 #endif // __core__date_h |