Hi, I'm really new to scripting and despite a bit of ChatGPT help, I haven't got anything to work yet. I'm hoping that with a basic bit of help here that I can get going with my relatively limited coding knowledge...
I am doing a "when a record matches conditions..." trigger, and then hoping to find at records that have a start time of 00:00, update it to 09:00. this is because I'm hoping to drag/drop bookings onto a timeline and they default to 00:00 to 00:00 which doesn't work for our bookings system.
I've found the field, and I can see in the record info, the {start} field shows (eg) 24-01-31T00:00:00.000Z.
I figured the easiest thing is to add 9 hours to that, so I'd started with this:
// Retrieve the start date-time from the input variables
let startDateTime = input.config().startDateTime; // 'startDateTime' matches the name given in step setup
// Check if startDateTime is provided
if (startDateTime) {
// Parse the start date-time string to a Date object
let startDate = new Date(startDateTime);
// Add 9 hours
startDate.setHours(startDate.getHours() + 9);
// Output the new date-time in ISO format
output.set('newStartDateTime', startDate.toISOString());
}
But this seems to not pick up any variables on the input.config().
Any help much appreciated