mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 06:32:03 +00:00
fix(ui): own the time picker so it follows the 24-hour preference
The native datetime-local / time picker renders its clock and AM/PM toggle by the browser UI language, not the page lang or the app's time-format preference — so an English-language browser showed AM/PM even with 24-hour selected. Replace the native time control with an app-controlled TimeField (text entry + a dependency-free popover of hour/minute, plus AM/PM in 12-hour mode) whose hour cycle always tracks the preference. DateTimeField now composes the native calendar (date) with TimeField (time); the committed value stays a local yyyy-MM-ddTHH:mm string, and min/max clamp the recombined value. Also thread the time-format preference into the doctor-report PDF so its generated-at timestamp honours it instead of the locale default.
This commit is contained in:
1 parent
426b21497a
commit
7e901e674a
19 files changed
+826
-243
No files matched your search
@@ -119,7 +119,11 @@ export const POST = apiHandler(async (request: NextRequest) => {
|
||||
resolveUserTimezone(user.id),
|
||||
prisma.user.findUnique({
|
||||
where: { id: user.id },
|
||||
select: { insuranceNumberEncrypted: true, insightsCachedText: true },
|
||||
select: {
|
||||
insuranceNumberEncrypted: true,
|
||||
insightsCachedText: true,
|
||||
timeFormat: true,
|
||||
},
|
||||
}),
|
||||
// v1.25 (W-RECORDS) — structured records are always-available reference
|
||||
// data (not time-windowed), so they ride alongside the report rather
|
||||
@@ -203,6 +207,7 @@ export const POST = apiHandler(async (request: NextRequest) => {
|
||||
t,
|
||||
locale,
|
||||
userTz,
|
||||
timeFormat: userRow?.timeFormat ?? "AUTO",
|
||||
insuranceNumber,
|
||||
includeCharts,
|
||||
aiSummary,
|
||||
|
||||
Reference in new issue
Block a user