GameList: Allow sorting by more columns (#1571)
Some checks failed
Build check / build (push) Waiting to run
Generate translation template / generate-pot (push) Failing after 25s

This commit is contained in:
goeiecool9999 2025-06-13 12:47:46 +02:00 committed by GitHub
parent 2eec6b44c3
commit f3fe6f3455
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 84 additions and 18 deletions

View file

@ -464,5 +464,34 @@ namespace iosu
return static_cast<IOSUModule*>(&sIOSUModuleNNPDM);
}
bool GameListStat::LastPlayDate::operator<(const LastPlayDate& b) const
{
const auto& a = *this;
if(a.year < b.year)
return true;
if(a.year > b.year)
return false;
// same year
if(a.month < b.month)
return true;
if(a.month > b.month)
return false;
// same year and month
return a.day < b.day;
}
bool GameListStat::LastPlayDate::operator==(const LastPlayDate& b) const
{
const auto& a = *this;
return a.year == b.year &&
a.month == b.month &&
a.day == b.day;
}
std::weak_ordering GameListStat::LastPlayDate::operator<=>(const LastPlayDate& b) const = default;
};
};