Change int to qint64

This commit is contained in:
Jonas Kvinge
2021-02-10 18:27:40 +01:00
parent 1f9af7a1e4
commit b3681002a7
6 changed files with 12 additions and 12 deletions

View File

@@ -152,11 +152,11 @@ QString WordyTimeNanosec(qint64 nanoseconds) {
return WordyTime(nanoseconds / kNsecPerSec);
}
QString Ago(int seconds_since_epoch, const QLocale &locale) {
QString Ago(qint64 seconds_since_epoch, const QLocale &locale) {
const QDateTime now = QDateTime::currentDateTime();
const QDateTime then = QDateTime::fromSecsSinceEpoch(seconds_since_epoch);
const int days_ago = then.date().daysTo(now.date());
const qint64 days_ago = then.date().daysTo(now.date());
const QString time = then.time().toString(locale.timeFormat(QLocale::ShortFormat));
if (days_ago == 0) return tr("Today") + " " + time;
@@ -170,7 +170,7 @@ QString Ago(int seconds_since_epoch, const QLocale &locale) {
QString PrettyFutureDate(const QDate &date) {
const QDate now = QDate::currentDate();
const int delta_days = now.daysTo(date);
const qint64 delta_days = now.daysTo(date);
if (delta_days < 0) return QString();
if (delta_days == 0) return tr("Today");