Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DateTimeMask Class

Defines built-in patterns for date-time and date-time offset masks.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public static class DateTimeMask

#Remarks

Use properties of the DateTimeMask class to apply commonly used mask patterns to data editors. Each property is a wrapper for the corresponding standard date and time format string. This technique simplifies the setup process.

<DxDateEdit @bind-Date="Value"
            Mask="@DateTimeMask.ShortDate" />
@code {
    DateTime Value { get; set; } = DateTime.Now;
}

Date-Time Masks - ShortDate

The appearance of a mask pattern depends on the current culture. For instance, the same mask can specify different patterns in the U.S. and France.

Users can change the regional format in the SettingsTime & LanguageRegion system dialog. To change the culture programmatically, use the Culture property. The culture’s DateTimeFormat property defines the culture-specific date-time format.

#Inheritance

Object
DateTimeMask
See Also