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
dateDateTimeThe DateTime to check.
fromDateTimeThe lower bound of the range.
toDateTimeThe 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
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
Returns
- bool
True if the day of week is Saturday or Sunday; otherwise, false.