Hi Observable.
Another newbie question for you: How can I ensure that a variable remains constant?
I am trying to add in a new calculation to add 45 days to a start_date
value (a report deadline). I try doing this by noting the value should remain constant:
report_due_gen = {
const date = start_date;
date.setDate(date.getDate() + 45);
return date
}
However, adding in this calculation changes anther calculation also based on the start date, namely:
${start_date.toLocaleString(
undefined, {timeZone: "utc", month: "long", day: "numeric", year: "numeric"}
)}
The console isnât returning any errors. Any pointers on how to debug?
Hereâs the notebook:
Thanks in advance for your time and guidance!