fix: UTC-Bug bei Datum-Defaults - new Date().toISOString() durch lokale Formatierung ersetzt

This commit is contained in:
2026-06-19 01:13:18 +02:00
parent 82565f2482
commit 3980aeedd0
2 changed files with 15 additions and 4 deletions

View File

@@ -45,7 +45,11 @@ function BestellungDetail({ id, toast, onBack }) {
const [pickerSearch,setPickerSearch]= useState('');
const [editMode, setEditMode] = useState(false);
const [form, setForm] = useState({ name:'', bemerkung:'', custom_price:'', status:'warteliste' });
const today = () => new Date().toISOString().slice(0,10);
const today = () => {
const d = new Date();
const y = d.getFullYear(), m = String(d.getMonth()+1).padStart(2,'0'), day = String(d.getDate()).padStart(2,'0');
return `${y}-${m}-${day}`;
};
const [bezahltDate, setBezahltDate] = useState(today());
const [abgeholtDate, setAbgeholtDate] = useState(today());
const [showBezahltPicker, setShowBezahltPicker] = useState(false);