Table of Contents

Class PreviousWeekDay

Namespace
Albatross.Expression.Prefix
Assembly
Albatross.Expression.dll

Prefix expression that finds the previous weekday (Monday-Friday) from a given date. Takes 1-2 parameters: the starting date and optional number of weekdays to go back (defaults to 1).

public class PreviousWeekDay : PrefixExpression, IPrefixExpression, IExpression, IToken
Inheritance
PreviousWeekDay
Implements
Inherited Members
Extension Methods

Constructors

PreviousWeekDay()

Initializes a new instance of the PreviousWeekDay class with name "PreviousWeekDay" and 1-2 parameters.

public PreviousWeekDay()

Methods

Run(List<object>)

Finds the previous weekday by going back the specified number of weekdays from the given date. Skips weekends (Saturday and Sunday) and returns the previous business day.

protected override object Run(List<object> operands)

Parameters

operands List<object>

List containing 1-2 operands: starting date and optional weekday count (defaults to 1).

Returns

object

A DateTime representing the previous weekday after going back the specified count.

Exceptions

FormatException

Thrown when operands cannot be converted to appropriate types.