Skip to content

Commit

Permalink
fix showing seconds in time
Browse files Browse the repository at this point in the history
  • Loading branch information
xmdnx committed May 4, 2024
1 parent a6e254f commit d3835e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ For license and copyright information please follow this link:
*/
#include "dialogs/ui/dialogs_layout.h"

#include "rabbit/settings/rabbit_settings.h"

#include "data/data_drafts.h"
#include "data/data_forum_topic.h"
#include "data/data_saved_sublist.h"
Expand Down
6 changes: 5 additions & 1 deletion Telegram/SourceFiles/ui/text/format_values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ For license and copyright information please follow this link:
*/
#include "ui/text/format_values.h"

#include "rabbit/settings/rabbit_settings.h"

#include "lang/lang_keys.h"
#include "countries/countries_instance.h"

Expand Down Expand Up @@ -494,7 +496,9 @@ QString FormatDialogsDate(const QDateTime &lastTime) {

if ((lastDate == nowDate)
|| (std::abs(lastTime.secsTo(now)) < kRecentlyInSeconds)) {
return QLocale().toString(lastTime.time(), QLocale::ShortFormat);
return RabbitSettings::JsonSettings::GetBool("show_seconds")
? QLocale().toString(lastTime.time(), QLocale::LongFormat).remove(" t")
: QLocale().toString(lastTime.time(), QLocale::ShortFormat);
} else if (std::abs(lastDate.daysTo(nowDate)) < 7) {
return langDayOfWeek(lastDate);
} else {
Expand Down

0 comments on commit d3835e9

Please sign in to comment.