summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/windows/mailviewwindow.cpp4
-rw-r--r--src/gui/windows/mailviewwindow.h1
-rw-r--r--src/utils/stringutils.cpp3
3 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/windows/mailviewwindow.cpp b/src/gui/windows/mailviewwindow.cpp
index d0d42f168..df2fe1eec 100644
--- a/src/gui/windows/mailviewwindow.cpp
+++ b/src/gui/windows/mailviewwindow.cpp
@@ -69,6 +69,9 @@ MailViewWindow::MailViewWindow(MailMessage *const message,
// TRANSLATORS: mail view window label
mTimeLabel(new Label(this, strprintf("%s %s", _("Time:"),
message->strTime.c_str()))),
+ // TRANSLATORS: mail view window label - mail expiry time
+ mExpireTimeLabel(new Label(this, strprintf("%s %s", _("Expires at:"),
+ timeToStr(message->expireTime).c_str()))),
mMoneyLabel(nullptr),
// TRANSLATORS: mail view window label
mFromLabel(new Label(this, strprintf("%s %s", _("From:"),
@@ -107,6 +110,7 @@ MailViewWindow::MailViewWindow(MailMessage *const message,
int n = 0;
placer(0, n++, mTimeLabel, 1, 1);
+ placer(0, n++, mExpireTimeLabel, 1, 1);
placer(0, n++, mFromLabel, 1, 1);
placer(0, n++, mSubjectLabel, 1, 1);
if (message->money != 0)
diff --git a/src/gui/windows/mailviewwindow.h b/src/gui/windows/mailviewwindow.h
index 201fea426..6a5da1157 100644
--- a/src/gui/windows/mailviewwindow.h
+++ b/src/gui/windows/mailviewwindow.h
@@ -66,6 +66,7 @@ class MailViewWindow final : public Window,
Button *mNextButton;
Button *mReplyButton;
Label *mTimeLabel;
+ Label *mExpireTimeLabel;
Label *mMoneyLabel;
Label *mFromLabel;
Label *mSubjectLabel;
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 8daaf3be2..cd2a87ab2 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -947,7 +947,8 @@ std::string timeToStr(const uint32_t time)
char buf[101];
const time_t tempTime = time;
tm *const timeInfo = localtime(&tempTime);
- if (strftime(&buf[0], 100, "%Y-%m-%d_%H-%M-%S", timeInfo) != 0U)
+ // %c is locale-defined format
+ if (strftime(&buf[0], 100, "%c", timeInfo) != 0U)
return std::string(buf);
return "unknown";
}