feat: refactor date formatting and timezone utilities for improved consistency and functionality
Some checks failed
Frontend CI / lint (push) Failing after 19s
Frontend CI / build (push) Has been skipped

This commit is contained in:
JSC
2025-08-15 23:43:17 +02:00
parent cd654b8777
commit 9cfa1f6a28
9 changed files with 148 additions and 45 deletions

View File

@@ -21,7 +21,7 @@ import { Skeleton } from '@/components/ui/skeleton'
import { useAuth } from '@/contexts/AuthContext'
import { useTheme } from '@/hooks/use-theme'
import { useLocale } from '@/hooks/use-locale'
import { getSupportedTimezones } from '@/lib/utils/locale'
import { getSupportedTimezones } from '@/utils/locale'
import {
type ApiTokenStatusResponse,
type UserProvider,
@@ -42,6 +42,7 @@ import {
} from 'lucide-react'
import { useEffect, useState } from 'react'
import { toast } from 'sonner'
import { formatDate } from '@/utils/format-date'
export function AccountPage() {
const { user, setUser } = useAuth()
@@ -320,7 +321,7 @@ export function AccountPage() {
</div>
<div>
Member since:{' '}
{new Date(user.created_at).toLocaleDateString()}
{formatDate(user.created_at)}
</div>
</div>
</div>
@@ -623,9 +624,7 @@ export function AccountPage() {
{apiTokenStatus.expires_at && (
<span className="text-muted-foreground">
(Expires:{' '}
{new Date(
apiTokenStatus.expires_at,
).toLocaleDateString()}
{formatDate(apiTokenStatus.expires_at, false)}
)
</span>
)}