Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(groupinviteform): consider dateTime format in group invites
Browse files Browse the repository at this point in the history
Closes #3058
  • Loading branch information
a68366 committed Jul 6, 2016
1 parent a01293f commit 6030b08
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/widget/form/groupinviteform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <QLabel>
#include <QWindow>
#include "ui_mainwindow.h"
#include "src/persistence/settings.h"
#include "src/widget/tool/croppinglabel.h"
#include "src/widget/translator.h"
#include "src/nexus.h"
Expand Down Expand Up @@ -107,8 +108,10 @@ void GroupInviteForm::addGroupInvite(int32_t friendId, uint8_t type, QByteArray
CroppingLabel* groupLabel = new CroppingLabel(this);
groupLabels.insert(groupLabel);
QString name = Nexus::getCore()->getFriendUsername(friendId);
QString time = QDateTime::currentDateTime().toString();
groupLabel->setText(tr("Invited by <b>%1</b> on %2.").arg(name, time));
QDateTime currentDateTime = QDateTime::currentDateTime();
QString date = currentDateTime.toString(Settings::getInstance().getDateFormat());
QString time = currentDateTime.toString(Settings::getInstance().getTimestampFormat());
groupLabel->setText(tr("Invited by <b>%1</b> on %2 at %3.").arg(name, date, time));
groupLayout->addWidget(groupLabel);

QPushButton* acceptButton = new QPushButton(this);
Expand Down Expand Up @@ -206,8 +209,11 @@ void GroupInviteForm::retranslateGroupLabel(CroppingLabel* label)
GroupInvite invite = groupInvites.at(index);

QString name = Nexus::getCore()->getFriendUsername(invite.friendId);
QString date = invite.time.toString();
label->setText(tr("Invited by <b>%1</b> on %2.").arg(name, date));

QString date = invite.time.toString(Settings::getInstance().getDateFormat());
QString time = invite.time.toString(Settings::getInstance().getTimestampFormat());

label->setText(tr("Invited by <b>%1</b> on %2 at %3.").arg(name, date, time));
}

void GroupInviteForm::retranslateAcceptButton(QPushButton* acceptButton)
Expand Down

0 comments on commit 6030b08

Please sign in to comment.