Calendar.MakeNightShiftCalendar
Contents
[
Hide
]Calendar.MakeNightShiftCalendar method
Makes a given Calendar as Night Shift Calendar.
public static Calendar MakeNightShiftCalendar(Calendar calendar)
Parameter | Type | Description |
---|---|---|
calendar | Calendar | Calendar to make Night Shift Calendar. |
Return Value
Night Shift Calendar.
Examples
Shows how to create a night shift calendar.
Project project = new Project();
var calendar = project.Calendars.Add("New calendar");
Calendar.MakeNightShiftCalendar(calendar);
var workingHours = calendar.GetWorkingTimes(new DateTime(2020, 4, 8));
// show working hours
foreach (var wh in workingHours)
{
Console.WriteLine("From: " + wh.From);
Console.WriteLine("To: " + wh.To);
}
Shows how to transform a calendar into a night shift calendar.
var project = new Project();
var calendar = project.Calendars.Add("Night Shift");
calendar = Calendar.MakeNightShiftCalendar(calendar);
var workingHours = calendar.GetWorkingTimes(new DateTime(2020, 4, 8));
// show working hours
foreach (var wh in workingHours)
{
Console.WriteLine("From: " + wh.From);
Console.WriteLine("To: " + wh.To);
}
See Also
- class Calendar
- namespace Aspose.Tasks
- assembly Aspose.Tasks