aboutsummaryrefslogtreecommitdiffstats
path: root/src/activitypub/apquestion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/activitypub/apquestion.cpp')
-rw-r--r--src/activitypub/apquestion.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/activitypub/apquestion.cpp b/src/activitypub/apquestion.cpp
index d519947..06fde9e 100644
--- a/src/activitypub/apquestion.cpp
+++ b/src/activitypub/apquestion.cpp
@@ -1,4 +1,5 @@
#include "apquestion.h"
+#include "src/settings_interface.h"
#include <QDebug>
APQuestion::APQuestion(APObjectFields fields) : APPost(fields) {
@@ -18,12 +19,14 @@ QString APQuestion::get_html_render(HtmlRenderDetails render_info) {
html.append(get_html_template("appoll"));
if (end_time.isValid()) {
- // TODO: add a UI setting for configuring the display of local time or UTC time.
- html.replace("{{end-time}}", render_info.locale->toString(end_time.toLocalTime()));
+ html.replace("{{end-time}}", render_info.locale->toString(
+ SettingsInterface::quick_read_setting("ui/timezone").value<AppSettingsTypes::Timezone>() ? end_time.toUTC() : end_time.toLocalTime()
+ ));
}
if (closed_time.isValid()) {
- // TODO: add a UI setting for configuring the display of local time or UTC time.
- html.replace("{{closed-time}}", render_info.locale->toString(closed_time.toLocalTime()));
+ html.replace("{{closed-time}}", render_info.locale->toString(
+ SettingsInterface::quick_read_setting("ui/timezone").value<AppSettingsTypes::Timezone>() ? closed_time.toUTC() : closed_time.toLocalTime()
+ ));
}
html.replace("{{total-votes}}", render_info.locale->toString(total_votes));