feat: Add comprehensive system enhancements
- Add version display above storage consumption in admin sidebar - Fix storage consumption to stick to bottom of window using flexbox - Add user upload settings to events (allow uploads, category selection) - Enhance disk space tab to comprehensive system status view - Add localized date formatting for German/English language support - Remove quick actions from dashboard for cleaner interface - Create user photo upload functionality for galleries - Add database migration for user upload settings - Update all TypeScript types and interfaces 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export * from './useSessionTimeout';
|
||||
export * from './useOnClickOutside';
|
||||
export * from './useLocalizedDate';
|
||||
@@ -0,0 +1,27 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { format as dateFnsFormat, formatDistanceToNow as dateFnsFormatDistanceToNow } from 'date-fns';
|
||||
import { de, enUS } from 'date-fns/locale';
|
||||
|
||||
export const useLocalizedDate = () => {
|
||||
const { i18n } = useTranslation();
|
||||
|
||||
const getLocale = () => {
|
||||
return i18n.language === 'de' ? de : enUS;
|
||||
};
|
||||
|
||||
const format = (date: Date | string, formatStr: string) => {
|
||||
const dateObj = typeof date === 'string' ? new Date(date) : date;
|
||||
return dateFnsFormat(dateObj, formatStr, { locale: getLocale() });
|
||||
};
|
||||
|
||||
const formatDistanceToNow = (date: Date | string, options?: { addSuffix?: boolean }) => {
|
||||
const dateObj = typeof date === 'string' ? new Date(date) : date;
|
||||
return dateFnsFormatDistanceToNow(dateObj, { ...options, locale: getLocale() });
|
||||
};
|
||||
|
||||
return {
|
||||
format,
|
||||
formatDistanceToNow,
|
||||
locale: getLocale()
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user