Skip to content

Commit

Permalink
Fix negative time on just added tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraxarn committed Nov 25, 2023
1 parent 723c293 commit 7210316
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/util/datetime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
auto DateTime::toRelative(const QDateTime &date) -> QString
{
auto amount = date.secsTo(QDateTime::currentDateTimeUtc());
if (amount <= 0)
{
return QStringLiteral("Just now");
}

QString unit = "second";

if (amount >= secsInYear)
Expand Down

0 comments on commit 7210316

Please sign in to comment.