We upgraded to modern dffs. There is Javascript code that reads a date/time field, adds some hours to it and stores the result in another field.
The old Javascript was not upgraded automatically.
I tried
x = getFieldValue(“InfoSecuritySetDate”);
x.setHours(x.getHours() + maxDelayHours);
setFieldValue(“Due_x0020_Date”, x);
This does not work because x is a String and not a Date object.
Question: how to retrieve the Date object that corresponds to InfoSecuritySetDate ? I have no idea what regional settings are used by the user. I cannot make assumptions about the regional settings of the Sharepoint site
Remark 1: the functions getFieldValue and setFieldValue are not documented in the user guide. I have found the functions via AI. Maybe there are other functions available that could be used.
Thanks
Regards