Hi Guillaume,
Thanks for posting your concern.
Upon checking the provided script, I can see that you did fine on implementing it. You just need to implement the
Default timezone in date object methods in your code. I am suggesting this because when you just use the
getDay() method (where you've used it in a condition), default timezone that will be used is
America/Los_Angeles (Pacific time) so the returned value for the said method will be varied with the expected date.
Please refer to the modified script below as the suggestion was applied to it.
function main() {
var adSelector = AdsApp
.ads()
.withCondition("LabelNames CONTAINS_ANY ['Monday 1']")
var now = new Date();
var timeZone = AdsApp.currentAccount().getTimeZone();
var formatDate = Utilities.formatDate(now, timeZone, 'MMMM dd, yyyy');
var today = new Date(formatDate).getDay();
var adIterator = adSelector.get();
while (adIterator.hasNext()) {
var ad = adIterator.next();
// Sunday
if (today == 0) {
ad.enable();
}
}
}
Please let me know if you have further questions/clarifications.
Regards,
Ejay
Google Ads Scripts Team

ref:_00D1U1174p._5001UCZ2fH:ref