Mercurial > minori
diff include/core/date.h @ 9:5c0397762b53
INCOMPLETE: megacommit :)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 10 Sep 2023 03:59:16 -0400 |
parents | |
children | d8eb763e6661 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/core/date.h Sun Sep 10 03:59:16 2023 -0400 @@ -0,0 +1,32 @@ +#ifndef __core__date_h +#define __core__date_h +#include "json.h" +#include <QDate> +#include <cstdint> +class Date { + public: + Date(); + Date(int32_t y); + Date(int32_t y, int8_t m, int8_t d); + void SetYear(int32_t y); + void SetMonth(int8_t m); + void SetDay(int8_t d); + void VoidYear(); + void VoidMonth(); + void VoidDay(); + int32_t GetYear() const; + int8_t GetMonth() const; + int8_t GetDay() const; + QDate GetAsQDate() const; + nlohmann::json GetAsAniListJson() const; + bool operator<(const Date& other) const; + bool operator>(const Date& other) const; + bool operator<=(const Date& other) const; + bool operator>=(const Date& other) const; + + private: + std::shared_ptr<int32_t> year; + std::shared_ptr<int8_t> month; + std::shared_ptr<int8_t> day; +}; +#endif // __core__date_h