Schedule not honoring .Skip() with .NET SDK 1.3.1, ExclusionCalendar blank in UI

Hello, I am running Temporal locally (via CLI 1.1.2) and trying to get my schedule to exclude holidays like Christmas and New Years. I can’t figure out why holidays I add to .Skip seem to be ignored. The UI shows ExclusionCalendar as blank. I tried setting DayOfMonth + Year, as well as all of the properties (hour, min, second). What am I doing wrong?

Here is my code I run to create the schedule using the latest .NET SDK:

async Task ScheduleStartAsync2()
{
    Console.WriteLine("Scheduling workflow in PST that runs Wed between 3pm except Christmas|NewYears");
    ScheduleRange[] first = [new ScheduleRange(1)];
    ScheduleRange[] twentyFifth = [new ScheduleRange(25)];
    ScheduleRange[] y2024 = [new ScheduleRange(2024)];
    ScheduleRange[] y2025 = [new ScheduleRange(2025)];
    ScheduleRange[] allHours = [new ScheduleRange(0, 23)];
    ScheduleRange[] allMinOrSec = [new ScheduleRange(0, 59)];
    var action = ScheduleActionStartWorkflow.Create<CalendarWorkflow>(
        wf => wf.RunAsync(),
        new()
        {
            Id = "schedule-workflow-id",
            TaskQueue = "CALENDAR_TASK_QUEUE",
        });
    var spec = new ScheduleSpec
    {
        Calendars = new List<ScheduleCalendarSpec>
        { 
            new ScheduleCalendarSpec { 
                DayOfWeek = new List<ScheduleRange>{  new ScheduleRange(2) },
                Hour = new List<ScheduleRange>{ new ScheduleRange(15)} }
        },
        TimeZoneName = "America/Los_Angeles",
        Skip = new List<ScheduleCalendarSpec>
        {
            new ScheduleCalendarSpec { DayOfMonth = twentyFifth, Year = y2024, Hour = allHours, Minute = allMinOrSec, Second = allMinOrSec },
            new ScheduleCalendarSpec { DayOfMonth = first, Year = y2025 },
            new ScheduleCalendarSpec { DayOfMonth = twentyFifth, Year = y2025  },
        }
    };
    var schedule = new Schedule(action, spec)
    {
        Policy = new()
        {
            CatchupWindow = TimeSpan.FromDays(1),
            Overlap = ScheduleOverlapPolicy.AllowAll,
        },
    };
    var scheduleHandle = await client.CreateScheduleAsync("sample-schedule-exclude-hol", schedule);
    Console.WriteLine(@$"Started schedule {scheduleHandle.Id}");
}

Hey there,

When you say The UI shows ExclusionCalendar as blank, what is that referring to in the UI? Could you provide a screenshot if possible?


Here’s a screenshot. I assume “Exclusion Calendar” is supposed to represent the intervals set with .Skip()? But it shows as “None” even though I am setting some ranges in Skip:

Skip =
        [
            //new ScheduleCalendarSpec { DayOfMonth = twentyFifth, Year = y2024, Hour = allHours, Minute = allMinOrSec, Second = allMinOrSec },
            new ScheduleCalendarSpec { DayOfMonth = twentyFifth, Year = y2024, Month = [new ScheduleRange(12)] },
            new ScheduleCalendarSpec { DayOfMonth = first, Year = y2025, Month = [new ScheduleRange(1)] },
            new ScheduleCalendarSpec { DayOfMonth = twentyFifth, Year = y2025, Month = [new ScheduleRange(12)] },
        ]

So I realized every time element has to be set on the ScheduleCalendarSpec object for it to be excluded (eg, I had to set DayOfMonth, Year, Month, Hour, Minute, Seconds).

new ScheduleCalendarSpec { DayOfMonth = twentyFifth, Year = y2024, Month = [new ScheduleRange(12)], Hour = allHours, Minute = allMinOrSec, Second = allMinOrSec },

Also, it appears ExclusionCalendar is NOT associated with .Skip(), and there is no way for me to see the Skips in the UI other than deducing them by looking at Upcoming Runs.

My question has been answered, thank you!