Add timezone display to admin Next.js frontend

Display user timezone in:
- Notification Preferences table (new Timezone column)
- User detail page (Basic Information card)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-24 23:07:48 -06:00
parent c464ee093e
commit 0e2e1532d2
4 changed files with 18 additions and 0 deletions

View File

@@ -193,6 +193,15 @@ export default function NotificationPrefsPage() {
/> />
), ),
}, },
{
accessorKey: 'timezone',
header: 'Timezone',
cell: ({ row }) => (
<span className="text-sm">
{row.original.timezone || <span className="text-muted-foreground">-</span>}
</span>
),
},
{ {
id: 'notification_times', id: 'notification_times',
header: () => ( header: () => (

View File

@@ -239,6 +239,12 @@ export function UserDetailClient() {
</div> </div>
<div>{new Date(user.date_joined).toLocaleDateString()}</div> <div>{new Date(user.date_joined).toLocaleDateString()}</div>
</div> </div>
<div>
<div className="text-sm font-medium text-muted-foreground">
Timezone
</div>
<div>{user.timezone || '-'}</div>
</div>
</div> </div>
</CardContent> </CardContent>
</Card> </Card>

View File

@@ -652,6 +652,8 @@ export interface NotificationPreference {
task_overdue_hour: number | null; task_overdue_hour: number | null;
warranty_expiring_hour: number | null; warranty_expiring_hour: number | null;
daily_digest_hour: number | null; daily_digest_hour: number | null;
// User timezone (IANA name, auto-captured from X-Timezone header)
timezone: string | null;
created_at: string; created_at: string;
updated_at: string; updated_at: string;
} }

View File

@@ -28,6 +28,7 @@ export interface User {
export interface UserDetail extends User { export interface UserDetail extends User {
residences?: ResidenceSummary[]; residences?: ResidenceSummary[];
devices?: DeviceSummary[]; devices?: DeviceSummary[];
timezone?: string; // IANA timezone (auto-captured from mobile app)
} }
export interface ResidenceSummary { export interface ResidenceSummary {