comparison src/core/date.cpp @ 77:6f7385bd334c

*: update formatted all source files, no more subclassing QThread... many other changes :)
author Paper <mrpapersonic@gmail.com>
date Fri, 06 Oct 2023 06:18:53 -0400
parents 3d2decf093bb
children
comparison
equal deleted inserted replaced
76:3364fadc8a36 77:6f7385bd334c
103 else 103 else
104 return QDate(); 104 return QDate();
105 } 105 }
106 106
107 nlohmann::json Date::GetAsAniListJson() const { 107 nlohmann::json Date::GetAsAniListJson() const {
108 nlohmann::json result; 108 nlohmann::json result = {};
109 if (year.get()) 109 if (year.get())
110 result.insert(result.end(), {"year", *year}); 110 result["year"] = *year;
111 else 111 else
112 result.insert(result.end(), {"year", nullptr}); 112 result["year"] = nullptr;
113 if (month.get()) 113 if (month.get())
114 result.insert(result.end(), {"month", *month}); 114 result["month"] = *month;
115 else 115 else
116 result.insert(result.end(), {"month", nullptr}); 116 result["month"] = nullptr;
117 if (day.get()) 117 if (day.get())
118 result.insert(result.end(), {"day", *day}); 118 result["day"] = *day;
119 else 119 else
120 result.insert(result.end(), {"day", nullptr}); 120 result["day"] = nullptr;
121 return result; 121 return result;
122 } 122 }