Table of Contents

Class DateTimeExtensions

Namespace
MADE.Data.Validation.Extensions
Assembly
MADE.Data.Validation.dll

Defines a collection of data validation extensions for DateTime objects.

public static class DateTimeExtensions
Inheritance
DateTimeExtensions
Inherited Members

Methods

IsInRange(DateTime, DateTime, DateTime)

Determines whether a DateTime is within a valid range.

public static bool IsInRange(this DateTime date, DateTime from, DateTime to)

Parameters

date DateTime

The DateTime to check.

from DateTime

The lower bound of the range.

to DateTime

The upper bound of the range.

Returns

bool

True if the date is within the valid range.

IsWeekday(DateTime)

Determines whether a DateTime is a day of the week other than Sunday or Saturday.

public static bool IsWeekday(this DateTime date)

Parameters

date DateTime

The DateTime to check.

Returns

bool

True if the day of week is between Monday and Friday; otherwise, false.

IsWeekend(DateTime)

Determines whether a DateTime is a day of the week other than Monday through Friday.

public static bool IsWeekend(this DateTime date)

Parameters

date DateTime

The DateTime to check.

Returns

bool

True if the day of week is Saturday or Sunday; otherwise, false.