Class CalendarExtensions
Extension methods for the Calendar
Inherited Members
Namespace: PayrollEngine.Client.Scripting.Runtime.Api
Assembly: PayrollEngine.Client.Services.dll
Syntax
public static class CalendarExtensions
Remarks
Duplicate of the backend calendar extension (no holiday support)
Methods
View SourceGetNextWorkDays(Calendar, DateTime, int)
Get next working days
Declaration
public static List<DateTime> GetNextWorkDays(this Calendar calendar, DateTime moment, int count = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| Calendar | calendar | |
| DateTime | moment | The start moment (not included in results) |
| int | count | The number of days (default: 1) |
Returns
| Type | Description |
|---|---|
| List<DateTime> | Returns true for valid time units |
GetPreviousWorkDays(Calendar, DateTime, int)
Get previous working days
Declaration
public static List<DateTime> GetPreviousWorkDays(this Calendar calendar, DateTime moment, int count = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| Calendar | calendar | |
| DateTime | moment | The start moment (not included in results) |
| int | count | The number of days (default: 1) |
Returns
| Type | Description |
|---|---|
| List<DateTime> | Returns true for valid time units |
IsWorkDay(Calendar, DateTime)
Test for working days
Declaration
public static bool IsWorkDay(this Calendar calendar, DateTime moment)
Parameters
| Type | Name | Description |
|---|---|---|
| Calendar | calendar | |
| DateTime | moment | Test day |
Returns
| Type | Description |
|---|---|
| bool | Returns true for valid time units |