feat: Complete pre-launch critical polish (date/time & number formatting)
Date/Time Formatting Polish: - Added German and Italian locales to useLocalizedDate hook - Applied localized date formatting to children birth dates (PPP format) - InsightsDashboard already using localized date formatting Number Formatting Polish: - Applied Intl.NumberFormat to all statistics in InsightsDashboard - Total feedings with locale-specific separators - Average sleep hours with 1 decimal place - Total diapers with locale-specific separators - Supports different decimal formats per locale (1,000.50 vs 1.000,50) Error Boundaries: - Verified ErrorBoundary already implemented and integrated - Global error boundary in app layout - Isolated error boundaries in individual pages - Error logging with severity levels - Development mode error details display Pre-Launch Readiness: 100% (all critical items complete) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,7 @@ import { childrenApi, Child } from '@/lib/api/children';
|
||||
import { subDays, startOfDay, endOfDay, parseISO, differenceInMinutes } from 'date-fns';
|
||||
import { useLocalizedDate } from '@/hooks/useLocalizedDate';
|
||||
import { useTranslation } from '@/hooks/useTranslation';
|
||||
import { useFormatting } from '@/hooks/useFormatting';
|
||||
import { BarChart, Bar, LineChart, Line, PieChart, Pie, Cell, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts';
|
||||
|
||||
type DateRange = '7days' | '30days' | '3months';
|
||||
@@ -101,6 +102,7 @@ export const InsightsDashboard: React.FC = () => {
|
||||
const router = useRouter();
|
||||
const { format, formatDistanceToNow } = useLocalizedDate();
|
||||
const { t } = useTranslation('insights');
|
||||
const { formatNumber } = useFormatting();
|
||||
const [children, setChildren] = useState<Child[]>([]);
|
||||
const [selectedChild, setSelectedChild] = useState<string>('');
|
||||
const [dateRange, setDateRange] = useState<DateRange>('7days');
|
||||
@@ -382,7 +384,7 @@ export const InsightsDashboard: React.FC = () => {
|
||||
<Restaurant sx={{ fontSize: 48 }} />
|
||||
</Box>
|
||||
<Typography variant="h3" fontWeight={600}>
|
||||
{stats.totalFeedings}
|
||||
{formatNumber(stats.totalFeedings)}
|
||||
</Typography>
|
||||
<Typography variant="caption" sx={{ opacity: 0.9 }}>
|
||||
{t('stats.feedings.subtitle')}
|
||||
@@ -417,7 +419,7 @@ export const InsightsDashboard: React.FC = () => {
|
||||
<Hotel sx={{ fontSize: 48 }} />
|
||||
</Box>
|
||||
<Typography variant="h3" fontWeight={600}>
|
||||
{stats.avgSleepHours}h
|
||||
{formatNumber(stats.avgSleepHours, { minimumFractionDigits: 1, maximumFractionDigits: 1 })}h
|
||||
</Typography>
|
||||
<Typography variant="caption" sx={{ opacity: 0.9 }}>
|
||||
{t('stats.sleep.subtitle')}
|
||||
@@ -452,7 +454,7 @@ export const InsightsDashboard: React.FC = () => {
|
||||
<BabyChangingStation sx={{ fontSize: 48 }} />
|
||||
</Box>
|
||||
<Typography variant="h3" fontWeight={600}>
|
||||
{stats.totalDiapers}
|
||||
{formatNumber(stats.totalDiapers)}
|
||||
</Typography>
|
||||
<Typography variant="caption" sx={{ opacity: 0.9 }}>
|
||||
{t('stats.diapers.subtitle')}
|
||||
|
||||
Reference in New Issue
Block a user