Table of Contents

Class DateHelpers

Namespace
TwBlazor.Utilities
Assembly
TwBlazor.dll

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

date DateTime

Returns

DateTime

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

date DateTime

Returns

int

GetWeekOfYear(DateTime)

Gets the ISO 8601 week number (1-53) for the given date.

public static int GetWeekOfYear(DateTime date)

Parameters

date DateTime

Returns

int

GetWeekdayHeaders()

Gets the short weekday names for the current culture, Monday first to match GetStartOfWeek(DateTime).

public static IReadOnlyList<string> GetWeekdayHeaders()

Returns

IReadOnlyList<string>