mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-16 03:59:40 +02:00
Projects included: - maerchenzauber (NestJS backend + Expo mobile + SvelteKit web + Astro landing) - manacore (Expo mobile + SvelteKit web + Astro landing) - manadeck (NestJS backend + Expo mobile + SvelteKit web) - memoro (Expo mobile + SvelteKit web + Astro landing) This commit preserves the current state before monorepo restructuring. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
/**
|
|
* @deprecated Use formatters.ts instead
|
|
* Legacy date/time formatters - migrating to consolidated formatters
|
|
*/
|
|
|
|
import {
|
|
formatDate as formatDateNew,
|
|
formatTime as formatTimeNew,
|
|
formatSimpleDuration
|
|
} from '~/utils/formatters';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
/**
|
|
* @deprecated Use formatDate from ~/utils/formatters.ts
|
|
*/
|
|
export function formatDate(date: Date): string {
|
|
return formatDateNew(date);
|
|
}
|
|
|
|
/**
|
|
* Hook to get locale-aware date formatter
|
|
*/
|
|
export function useFormatDate() {
|
|
const { i18n } = useTranslation();
|
|
|
|
return (date: Date, options?: Intl.DateTimeFormatOptions) => {
|
|
return formatDateNew(date, i18n.language, options);
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @deprecated Use formatTime from ~/utils/formatters.ts
|
|
*/
|
|
export function formatTime(date: Date): string {
|
|
return formatTimeNew(date);
|
|
}
|
|
|
|
/**
|
|
* Hook to get locale-aware time formatter
|
|
*/
|
|
export function useFormatTime() {
|
|
const { i18n } = useTranslation();
|
|
|
|
return (date: Date, includeUhr: boolean = true) => {
|
|
return formatTimeNew(date, i18n.language, includeUhr);
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @deprecated Use formatSimpleDuration from ~/utils/formatters.ts
|
|
*/
|
|
export function formatDuration(durationInSeconds: number): string {
|
|
return formatSimpleDuration(durationInSeconds);
|
|
}
|