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

DxDateTimeMaskProperties Class

Defines date-time mask settings.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public class DxDateTimeMaskProperties :
    DxMaskPropertiesBase

#Remarks

You can apply date-time input masks to the Date Edit, Time Edit, and Masked Input components. Date-time masks allow users to enter only date and/or time values. Users can navigate between mask sections (such as months, days, and hours) and increase or decrease section values with the Up and Down arrow keys, and the mouse wheel.

Date-Time Masks

Run Demo: Date Edit Run Demo: Time Edit Run Demo: Masked Input

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

Razor
@using System.Globalization

<DxDateEdit @bind-Date="@date" 
            Mask="@DateTimeMask.ShortDate">
    <DxDateTimeMaskProperties CaretMode="@MaskCaretMode.Advancing"
                              Culture="Culture"
                              InvalidInputNotificationText="The date is invalid."
                              UpdateNextSectionOnCycleChange="true" />
</DxDateEdit>

@code {
    DateTime date { get; set; } = DateTime.Now;
    CultureInfo Culture = new CultureInfo("fr-FR");
}

Refer to the following topic for more information: Mask Settings.

See Also