use same datetime format in "written by" section of article preview

This commit is contained in:
Martin Rotter 2021-09-08 11:55:45 +02:00
parent 0178a046eb
commit 3bdcdc0c21

View File

@ -130,6 +130,11 @@ void WebViewer::loadMessages(const QList<Message>& messages, RootItem* root) {
}
}
QString msg_date = qApp->settings()->value(GROUP(Messages), SETTING(Messages::UseCustomDate)).toBool()
? message.m_created.toLocalTime().toString(qApp->settings()->value(GROUP(Messages),
SETTING(Messages::CustomDateFormat)).toString())
: QLocale().toString(message.m_created.toLocalTime(), QLocale::FormatType::ShortFormat);
messages_layout.append(single_message_layout
.arg(message.m_title,
tr("Written by ") + (message.m_author.isEmpty() ?
@ -137,7 +142,7 @@ void WebViewer::loadMessages(const QList<Message>& messages, RootItem* root) {
message.m_author),
message.m_url,
message.m_contents,
QLocale().toString(message.m_created.toLocalTime(), QLocale::FormatType::ShortFormat),
msg_date,
enclosures,
enclosure_images));
}