From 5b604a0b8ad17bdba423a9cfabf8432031765b0a Mon Sep 17 00:00:00 2001 From: Bart Oostveen Date: Sun, 2 Aug 2026 01:19:06 +0200 Subject: [PATCH] fix(user-profile): respect 24-hour clock setting for local time --- ...l_time_did_not_respect_the_24_hour_time_format_setting.md | 5 +++++ src/app/components/user-profile/UserRoomProfile.tsx | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changeset/fix_an_inconsistency_where_a_user_profiles_local_time_did_not_respect_the_24_hour_time_format_setting.md diff --git a/.changeset/fix_an_inconsistency_where_a_user_profiles_local_time_did_not_respect_the_24_hour_time_format_setting.md b/.changeset/fix_an_inconsistency_where_a_user_profiles_local_time_did_not_respect_the_24_hour_time_format_setting.md new file mode 100644 index 000000000..56cc44d7a --- /dev/null +++ b/.changeset/fix_an_inconsistency_where_a_user_profiles_local_time_did_not_respect_the_24_hour_time_format_setting.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +# Fix an inconsistency where a user profile's local time did not respect the "24-Hour Time Format" setting diff --git a/src/app/components/user-profile/UserRoomProfile.tsx b/src/app/components/user-profile/UserRoomProfile.tsx index 2425ea748..053c1cc3c 100644 --- a/src/app/components/user-profile/UserRoomProfile.tsx +++ b/src/app/components/user-profile/UserRoomProfile.tsx @@ -106,6 +106,8 @@ function UserExtendedSection({ const [miscDataIndex, setMiscDataIndex] = useState(-1); const [renderAnimals] = useSetting(settingsAtom, 'renderAnimals'); + const [hour24Clock] = useSetting(settingsAtom, 'hour24Clock'); + const isCat = profile.isCat === true; const hasCats = profile.hasCats === true; const isAnimal = profile.isAnimal ?? (isCat && 'cat'); @@ -139,11 +141,12 @@ function UserExtendedSection({ hour: 'numeric', minute: '2-digit', timeZone: profile.timezone.replaceAll(/^["']|["']$/g, ''), + hour12: !hour24Clock, }).format(new Date()); } catch { return null; } - }, [profile.timezone]); + }, [profile.timezone, hour24Clock]); const bioContent = useMemo(() => { let rawBio =