The calendar can be updated programmatically using the AddHolidays sample job which is located in the Samples folder. The AddHolidays sample job source will need to be customized for your holiday calendar.
In JAMS V6, each calendar date update portion of the script looks like the following:
$newdate = ConvertTo-Date "
1st day of year" -today $baseDate
$holiday = New-Item JAMSHost:\Dates\
Holidays\ -value ("{0:yyyy-MM-dd}" -f $newdate) -force
$formattedDate= "{0:yyyy-MM-dd}" -f $newdate
$holiday = Get-Item JAMSHost:\Dates\
Holidays\$formattedDate
$holiday.Description = "
New Years Day"
$holiday.Workday = $
false
$holiday.Update()
All of the items marked in Red will need to be customized for your application. The first line contains the language specification for the day you want to mark off. The second line references the Date Definition that you are updating. The 4th line is the same reference to the date definition. The 5th line is a short description of the day that is being added. The 6th line is setting whether the date definition is a workday or not. The rest is powershell language used to perform the update through JAMS.
Users can then run the AddHolidays job at the end of every year and it will populate the days for next year's calendar.
Once created, is this a calendar that all jobs are required to abide by? Can specific jobs be forced to recognize holidays while other jobs are scheduled as usual?
Hi Kevin,
No, creating a calendar definition does not mean it applies to all jobs automatically, but it can be used in the Schedule Date or the Except For fields in a job definition.
Is there a version 7 example of Adding Calendar, Date Type and Holiday?
Hi Jayesh,
Information on Calendars in Version 7 can be found here: https://support.jamsscheduler.com/hc/en-us/articles/360007121711-New-Calendar-Features-Calendars-in-JAMS