a month ago
Hi community,
I’d like to ask how I can set blackout dates for a specific pipeline.
Recently, the blackout date format changed — now it’s possible to specify not only the date but also the time.
According to the metadata, the blackout date fields are:
jsonPath($, "$schedule.repeat.blackout_datetimes[*].startDate")
and
jsonPath($, "$schedule.repeat.blackout_datetimes[*].endDate")
My questions are:
How can I add a new blackout datetime if no blackout is currently defined (i.e. the fields don't exist yet, and concat fails)?
When a blackout already exists, adding a new one overwrites the existing start and end date/time.
I’m looking for a universal approach to append one new blackout datetime (start + end) to the list — without creating duplicates, and whether or not blackout dates already exist.
Thank you very much in advance!
4 weeks ago
Hi @SL12345 ,
Map your blackout dates in the following format and with the following expressions:
[].concat($schedule.repeat.get('blackout_datetimes') == null ? [] : $schedule.repeat.blackout_datetimes ,[{startDate:"2025-06-04",startTime:"00:00",endDate:"2025-06-05",endTime:"00:00"}])
You always start with an empty array, followed by a concat function with 2 arguments, the blackout_datetimes , which is extended with a ternary expression to check whether the array exists or not, and the blackout date times array you want to add.
This will safely update your blackoud dates with any overwriting of the previous ones.
Let me know if this helps.
Regards,
Bojan
4 weeks ago
I think you won't have any problems with mapping the blackout_dates since the field is already present even though no blackout dates are configured in the task, but anyways:
$schedule.repeat.blackout_dates.concat([ "2025-06-04","2025-06-05"])
Regards,
Bojan