Mercurial > minori
diff include/core/date.h @ 51:75c804f713b2
window: add about window,
*: use tr() when applicable (useful for i18n)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 25 Sep 2023 20:29:26 -0400 |
parents | d8eb763e6661 |
children | c69230dc2b5d |
line wrap: on
line diff
--- a/include/core/date.h Mon Sep 25 13:50:56 2023 -0400 +++ b/include/core/date.h Mon Sep 25 20:29:26 2023 -0400 @@ -6,18 +6,19 @@ class Date { public: Date(); - Date(int32_t y); - Date(int32_t y, int8_t m, int8_t d); + Date(unsigned int y); + Date(unsigned int y, unsigned int m, unsigned int d); + Date(const QDate& date); bool IsValid() const; - void SetYear(int32_t y); - void SetMonth(int8_t m); - void SetDay(int8_t d); + void SetYear(unsigned int y); + void SetMonth(unsigned int m); + void SetDay(unsigned int d); void VoidYear(); void VoidMonth(); void VoidDay(); - int32_t GetYear() const; - int8_t GetMonth() const; - int8_t GetDay() const; + unsigned int GetYear() const; + unsigned int GetMonth() const; + unsigned int GetDay() const; QDate GetAsQDate() const; nlohmann::json GetAsAniListJson() const; bool operator<(const Date& other) const; @@ -26,8 +27,10 @@ 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; + /* note: it might be worth it to change these all to int, as + large bit precisions aren't exactly useful here... */ + std::shared_ptr<unsigned int> year; + std::shared_ptr<unsigned int> month; + std::shared_ptr<unsigned int> day; }; #endif // __core__date_h