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/appost.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/appost.cpp')
-rw-r--r-- | src/activitypub/appost.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/activitypub/appost.cpp b/src/activitypub/appost.cpp index dadefe8..24a01f5 100644 --- a/src/activitypub/appost.cpp +++ b/src/activitypub/appost.cpp @@ -1,4 +1,5 @@ #include "appost.h" +#include "src/settings_interface.h" APPost::APPost(APObjectFields fields) { for (QString actor_url : fields.to_actors) @@ -44,9 +45,10 @@ QString APPost::get_html_render(HtmlRenderDetails render_info) { QString html(get_html_template("appost")); if (published.isValid()) { - // TODO: add a UI setting for configuring the display of local time or UTC time. // Using QLocale::toString() is forward compatible with Qt 6 as QDateTime::toString() will not return anymore a string in the system locale. - html.replace("{{published}}", render_info.locale->toString(published.toLocalTime())); + html.replace("{{published}}", render_info.locale->toString( + SettingsInterface::quick_read_setting("ui/timezone").value<AppSettingsTypes::Timezone>() ? published.toUTC() : published.toLocalTime() + )); } html.replace("{{url-id}}", object_url); |