diff options
author | ConfuSomu | 2023-08-16 12:33:07 -0400 |
---|---|---|
committer | ConfuSomu | 2023-08-16 12:36:57 -0400 |
commit | 52add29e0a380618a358fdbaddb612703d36eb90 (patch) | |
tree | 1e4889436f8bd785f83e63d2b75a58029aeb518a /src/activitypub/apquestion.cpp | |
parent | 597d1ae9b3e0e0b8f7f4fc27b674345e5b812c29 (diff) | |
download | ActorViewer-52add29e0a380618a358fdbaddb612703d36eb90.tar ActorViewer-52add29e0a380618a358fdbaddb612703d36eb90.tar.gz ActorViewer-52add29e0a380618a358fdbaddb612703d36eb90.zip |
Implement localtime/UTC time display setting
Diffstat (limited to 'src/activitypub/apquestion.cpp')
-rw-r--r-- | src/activitypub/apquestion.cpp | 11 |
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)); |