I created a calculation field to track email records in another app and added the “@ All of Date” variable to get the date and time value from the related field. If I use the Tape regular variable, I get the correct date but inaccurate time.
I’ve switched to date_fns as I seem to have forgotten how to use moment for now but one of the keys is that you have to format the date inside of your loop rather than outside (at least I’m fairly sure that’s the key).
Anyway the following seems to work for me.
const id = @All of Job Ref;
const url = @workList URL;
const title = @All of Name;
const date = @All of Created on;
const timezone = 'America/New_York'; // Define the desired timezone
let html = "<ol>";
for (var i = 0; i < id.length; i++) {
const formattedDate = date_fns.format(new Date(date[i]), 'EEE, MMM/dd/yy HH:mm', { timeZone: timezone }); // Format the date inside your loop
html += `<li><a href='${url}${id[i]}'>${title[i]}</a> | ${formattedDate}</li>`;
}
html += "</ol>";