Sure that your FIELD-ID is → “dateField” and not something like → “voucherExpire” ???
Also use CONSOLE to investigate and analy your own code…
const today=new Date(); console.log(today);
const todayLocal = today.toLocaleString(); console.log(todayLocal);