Class DateTimeExtensions
Defines a collection of data validation extensions for
Inheritance
System.Object
DateTimeExtensions
Namespace: MADE.Data.Validation.Extensions
Assembly: MADE.Data.Validation.dll
Syntax
public static class DateTimeExtensions : object
Methods
| Improve this Doc View SourceIsInRange(DateTime, DateTime, DateTime)
Determines whether a
Declaration
public static bool IsInRange(this DateTime date, DateTime from, DateTime to)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | The |
DateTime | from | The lower bound of the range. |
DateTime | to | The upper bound of the range. |
Returns
Type | Description |
---|---|
System.Boolean | True if the date is within the valid range. |
IsWeekday(DateTime)
Determines whether a
Declaration
public static bool IsWeekday(this DateTime date)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | The |
Returns
Type | Description |
---|---|
System.Boolean | True if the day of week is between Monday and Friday; otherwise, false. |
IsWeekend(DateTime)
Determines whether a
Declaration
public static bool IsWeekend(this DateTime date)
Parameters
Type | Name | Description |
---|---|---|
DateTime | date | The |
Returns
Type | Description |
---|---|
System.Boolean | True if the day of week is Saturday or Sunday; otherwise, false. |