Class DateHelpers
Shared date/time calculations used by calendar-style components (e.g. TwCalendar<T>).
public static class DateHelpers
- Inheritance
-
DateHelpers
- Inherited Members
Methods
GetStartOfWeek(DateTime)
Gets the Monday that starts the week containing date.
public static DateTime GetStartOfWeek(DateTime date)
Parameters
dateDateTime
Returns
GetWeekOfMonth(DateTime)
Gets the 1-based week-of-month for date (1-5, occasionally 6), counting
Monday-start weeks from the one containing the 1st of the month - the same grid a Month view
would lay the date out in, so this always matches which visual row it falls on there.
public static int GetWeekOfMonth(DateTime date)
Parameters
dateDateTime
Returns
GetWeekOfYear(DateTime)
Gets the ISO 8601 week number (1-53) for the given date.
public static int GetWeekOfYear(DateTime date)
Parameters
dateDateTime
Returns
GetWeekdayHeaders()
Gets the short weekday names for the current culture, Monday first to match GetStartOfWeek(DateTime).
public static IReadOnlyList<string> GetWeekdayHeaders()