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

DxDateEdit<T>.Mask Property

Specifies a mask pattern.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public string Mask { get; set; }

#Property Value

Type Description
String

A mask pattern.

#Remarks

The Date Edit component supports date-time and date-time offset masks. These mask types are similar and have the same functionality. Masks of both types allow users to enter only date and/or time values, but date-time offset masks store time offsets from Coordinated Universal Time (UTC) and allow users to change the offset values.

Date-Time Masks

Choose a mask from a number of predefined patterns or use a standard or custom format string. Assign a mask pattern to the Mask property to apply a mask to the Date Edit. Add the DxDateTimeMaskProperties or DxDateTimeOffsetMaskProperties component to the editor’s markup to customize mask-related settings:

<DxDateEdit @bind-Date="@date" 
            Mask="@DateTimeMask.ShortDate">
    <DxDateTimeMaskProperties UpdateNextSectionOnCycleChange="true" />
</DxDateEdit>

@code {
    DateTime date { get; set; } = DateTime.Now;
}

The appearance of a mask pattern depends on the client computer’s culture. Users can change the regional format in the SettingsTime & LanguageRegion system dialog. To change the culture programmatically, use the Culture property.

Refer to the following topic for more information: Apply a Mask.

See Also