First commit of the new app

This commit is contained in:
2026-05-26 09:18:37 +01:00
parent 295d1bda21
commit b427fb0f85
110 changed files with 6483 additions and 833 deletions

View File

@@ -0,0 +1,30 @@
import { API_BASE_URL } from '@/assets/config/api';
export const formatDateShort = (dateString: string) => {
if (!dateString) return '';
const d = new Date(dateString);
if (Number.isNaN(d.getTime())) return dateString;
return d.toLocaleDateString('pt-PT');
};
export const formatDateLong = (dateString: string) => {
if (!dateString) return '';
const d = new Date(dateString);
if (Number.isNaN(d.getTime())) return dateString;
return d.toLocaleDateString('pt-PT', {
day: '2-digit',
month: 'short',
year: 'numeric',
});
};
export const formatCurrency = (value: string) =>
`${parseFloat(value || '0').toFixed(0)} EUR`;
export const getImageUrl = (path?: string) => {
if (!path) return '';
if (path.startsWith('http')) return path;
const baseUrl = API_BASE_URL.replace(/\/pt\/app$/, '');
const imagePath = path.startsWith('/') ? path : `/${path}`;
return `${baseUrl}${imagePath}`;
};