blazor-devexpress-dot-blazor-dot-dxdateedit-1-7391637a.md
Specifies a mask pattern.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[Parameter]
public string Mask { get; set; }
| Type | Description |
|---|---|
| String |
A mask pattern.
|
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:
<DxDateEdit @bind-Date="@date"
Mask="@DateTimeMask.ShortDate">
<DxDateTimeMaskProperties UpdateNextSectionOnCycleChange="true" />
</DxDateEdit>
@code {
DateTime date { get; set; } = DateTime.Now;
}
<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 Settings → Time & Language → Region system dialog. To change the culture programmatically, use the Culture property.
Refer to the following topic for additional information: Apply a Mask.
See Also