-rw-r--r-- | library/timestring.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/timestring.cpp b/library/timestring.cpp index 6443b6b..8f60b72 100644 --- a/library/timestring.cpp +++ b/library/timestring.cpp @@ -222,72 +222,72 @@ void DateFormat::save(QDataStream &d) const void DateFormat::load(QDataStream &d) { ushort value; d >> value; _shortSeparator = QChar(value); uint v = 0; d >> v; _shortOrder = (Order)v; v = 0; d >> v; _longOrder = (Order)v; } QDataStream &operator<<(QDataStream &s, const DateFormat&df) { df.save(s); return s; } QDataStream &operator>>(QDataStream &s, DateFormat&df) { df.load(s); return s; } #endif QString TimeString::shortDate( const QDate &d, DateFormat dtf ) { return dtf.wordDate(d); } QString TimeString::dateString( const QDate &d, DateFormat dtf ) { - return dtf.wordDate(d, DateFormat::longNumber | DateFormat::longWord); + return QObject::tr( dtf.wordDate(d, DateFormat::longNumber | DateFormat::longWord) ); } QString TimeString::longDateString( const QDate &d, DateFormat dtf ) { - return dtf.wordDate(d, DateFormat::showWeekDay | DateFormat::longNumber - | DateFormat::longWord); + return QObject::tr( dtf.wordDate(d, DateFormat::showWeekDay | DateFormat::longNumber + | DateFormat::longWord) ); } DateFormat TimeString::currentDateFormat() { return TimeStringFormatKeeper::currentFormat(); } QString TimeString::dateString( const QDateTime &dt, bool ampm, bool seconds, DateFormat dtf ) { const QDate& d = dt.date(); const QTime& t = dt.time(); // based on QDateTime::toString() QString buf = timeString(t,ampm,seconds); buf += " "; buf += longDateString( d, dtf ); return buf; } QString TimeString::timeString( const QTime &t, bool ampm, bool seconds ) { if ( !ampm ) { if ( seconds ) return t.toString(); QString r = QString::number(t.hour()); if ( t.hour() < 10 ) r.prepend( "0" ); r.append( ":" ); if ( t.minute() < 10 ) r.append( "0" ); r.append(QString::number(t.minute())); return r; |