Back to Devexpress

DxDateEdit<T>.Mask Property

blazor-devexpress-dot-blazor-dot-dxdateedit-1-7391637a.md

latest3.1 KB
Original Source

DxDateEdit<T>.Mask Property

Specifies a mask pattern.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public string Mask { get; set; }

Property Value

TypeDescription
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.

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:

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

@code {
    DateTime date { get; set; } = DateTime.Now;
}
razor
<DxDateEdit @bind-Date="@date" 
            Mask="@DateTimeMask.ShortDate">
    <DxDateTimeOffsetMaskProperties UpdateNextSectionOnCycleChange="true" />
</DxDateEdit>

@code {
    DateTimeOffset date { get; set; } = DateTimeOffset.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 additional information: Apply a Mask.

See Also

DxDateEdit<T> Class

DxDateEdit<T> Members

DevExpress.Blazor Namespace