| 30 | |
| 31 | |
| 32 | QString DateDelegate::displayText(const QVariant &value, const QLocale &locale) const { |
| 33 | Q_UNUSED(locale); // suppress unused variable |
| 34 | |
| 35 | if (value.toLongLong() == 0) |
| 36 | return ""; |
| 37 | QDateTime timestamp; |
| 38 | timestamp.setTime_t(value.toLongLong()/1000); |
| 39 | |
| 40 | //QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedKingdom)); |
| 41 | if (timestamp.date() == QDate::currentDate()) |
| 42 | return tr("Today") +" " + timestamp.time().toString(global.timeFormat); |
| 43 | return timestamp.toString(global.dateFormat + QString(" ") +global.timeFormat); |
| 44 | // return timestamp.toString(Qt::SystemLocaleShortDate); |
| 45 | } |