Mercurial > minori
diff src/core/date.cc @ 389:1e5d922fe82b
kitsu: implement UpdateAnimeEntry
yay... i guess
| author | Paper <paper@tflc.us> |
|---|---|
| date | Thu, 06 Nov 2025 12:21:35 -0500 |
| parents | 47c9f8502269 |
| children |
line wrap: on
line diff
--- a/src/core/date.cc Thu Nov 06 09:53:06 2025 -0500 +++ b/src/core/date.cc Thu Nov 06 12:21:35 2025 -0500 @@ -154,3 +154,19 @@ return json; } + +std::string Date::GetAsISO8601() const +{ + std::stringstream res; + + res << year.value_or(2000); + res << '-'; + res << (static_cast<int>(month.value_or(Date::Month::Jan)) + 1); + res << '-'; + res << day.value_or(1); + + /* fake the rest... */ + res << "T00:00:00.000Z"; + + return res.str(); +}
