// Stałe i formattery — bez danych mock.

const STATIONS        = ['MOYA','BP','ORLEN','CIRCLEK','SHELL','MOL','AVIA'];
const VEHICLE_STATUSES = ['Aktywny','W serwisie','Wolny','Uszkodzony','Wypożyczony'];

const fmtPLN      = (n) => new Intl.NumberFormat('pl-PL', { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(n) + ' zł';
const fmtL        = (n) => new Intl.NumberFormat('pl-PL', { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(n) + ' l';
const fmtNum      = (n) => new Intl.NumberFormat('pl-PL').format(n);
const fmtDate     = (iso) => { const d = new Date(iso); const p = (x) => String(x).padStart(2,'0'); return `${p(d.getDate())}.${p(d.getMonth()+1)}.${d.getFullYear()}`; };
const fmtTime     = (iso) => { const d = new Date(iso); const p = (x) => String(x).padStart(2,'0'); return `${p(d.getHours())}:${p(d.getMinutes())}`; };
const fmtDateTime = (iso) => fmtDate(iso) + ' ' + fmtTime(iso);
const fmtDateInput = (iso) => { const d = new Date(iso); const p = (x) => String(x).padStart(2,'0'); return `${d.getFullYear()}-${p(d.getMonth()+1)}-${p(d.getDate())}`; };

Object.assign(window, {
  STATIONS, VEHICLE_STATUSES,
  fmtPLN, fmtL, fmtNum, fmtDate, fmtTime, fmtDateTime, fmtDateInput,
});
