comparison src/core/date.cpp @ 10:4b198a111713

Update things actually compile now btw qttest wants to fuck over the model but that might be my fault so /shrug
author Paper <mrpapersonic@gmail.com>
date Sat, 16 Sep 2023 02:06:01 -0400
parents 5c0397762b53
children fc1bf97c528b
comparison
equal deleted inserted replaced
9:5c0397762b53 10:4b198a111713
101 bool Date::operator>=(const Date& other) const { 101 bool Date::operator>=(const Date& other) const {
102 return !((*this) < other); 102 return !((*this) < other);
103 } 103 }
104 104
105 QDate Date::GetAsQDate() const { 105 QDate Date::GetAsQDate() const {
106 return QDate(*year, *month, *day); 106 /* QDates don't (yet) support "missing" values */
107 if (year.get() && month.get() && day.get())
108 return QDate(*year, *month, *day);
109 else return QDate();
107 } 110 }
108 111
109 nlohmann::json Date::GetAsAniListJson() const { 112 nlohmann::json Date::GetAsAniListJson() const {
110 nlohmann::json result; 113 nlohmann::json result;
111 if (year.get()) 114 if (year.get())