Mercurial > minori
comparison src/core/date.cc @ 319:d928ec7b6a0d
services/kitsu: implement GetAnimeList()
it finally works!
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Wed, 12 Jun 2024 17:52:26 -0400 |
| parents | b1f4d1867ab1 |
| children | 47c9f8502269 |
comparison
equal
deleted
inserted
replaced
| 318:3b355fa948c7 | 319:d928ec7b6a0d |
|---|---|
| 1 #include "core/date.h" | 1 #include "core/date.h" |
| 2 #include "core/time.h" | |
| 2 #include "core/json.h" | 3 #include "core/json.h" |
| 3 | 4 |
| 4 #include <QDate> | 5 #include <QDate> |
| 5 #include <QDebug> | 6 #include <QDebug> |
| 6 | 7 |
| 60 SetMonth(static_cast<Date::Month>(m)); | 61 SetMonth(static_cast<Date::Month>(m)); |
| 61 } | 62 } |
| 62 | 63 |
| 63 if (json.contains("/day"_json_pointer) && json.at("/day"_json_pointer).is_number()) | 64 if (json.contains("/day"_json_pointer) && json.at("/day"_json_pointer).is_number()) |
| 64 SetDay(json.at("/day"_json_pointer).get<unsigned char>()); | 65 SetDay(json.at("/day"_json_pointer).get<unsigned char>()); |
| 66 } | |
| 67 | |
| 68 Date::Date(Time::Timestamp timestamp) { | |
| 69 Date(QDateTime::fromSecsSinceEpoch(timestamp).date()); | |
| 65 } | 70 } |
| 66 | 71 |
| 67 void Date::VoidYear() { | 72 void Date::VoidYear() { |
| 68 year.reset(); | 73 year.reset(); |
| 69 } | 74 } |
