diff options
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); |