Class DateTimeExtensions
- Namespace
- MudBlazor.Extensions
- Assembly
- MudBlazor.dll
Represents methods added to DateTime types.
public static class DateTimeExtensions
- Inheritance
-
DateTimeExtensions
- Inherited Members
Methods
EndOfMonth(DateTime, CultureInfo)
Gets the last day of the month for this date.
public static DateTime EndOfMonth(this DateTime self, CultureInfo culture)
Parameters
self
DateTimeThe date to use for calculation.
culture
CultureInfoThe culture to use for formatting the date.
Returns
StartOfMonth(DateTime, CultureInfo)
Gets the first day of the month for this date.
public static DateTime StartOfMonth(this DateTime self, CultureInfo culture)
Parameters
self
DateTimeThe date to use for calculation.
culture
CultureInfoThe culture to use for formatting the date.
Returns
StartOfWeek(DateTime, DayOfWeek)
Gets the day at the start of the week for this date.
public static DateTime StartOfWeek(this DateTime self, DayOfWeek firstDayOfWeek)
Parameters
self
DateTimeThe date to use for calculation.
firstDayOfWeek
DayOfWeekThe day representing the first day of the week.
Returns
ToIsoDateString(DateTime)
Formats this date using the ISO 8601 standard.
public static string ToIsoDateString(this DateTime self)
Parameters
self
DateTime
Returns
- string
The date formatted as YYYY-MM-DD.
ToIsoDateString(DateTime?)
Formats this date using the ISO 8601 standard.
public static string? ToIsoDateString(this DateTime? self)
Parameters
self
DateTime?The date to format.
Returns
- string
The date formatted as YYYY-MM-DD.