CompatibilitySettings.IgnoreClientDateTimeOffsetInDateEdit Property
Specifies whether the Date Edit displays DateTimeOffset values without conversion to the client’s time zone.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v23.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public static bool IgnoreClientDateTimeOffsetInDateEdit { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
|
Remarks
Starting from v23.1, the Date Edit component uses the client time zone to display DateTimeOffset values (even if the server resides in a different time zone).
<DxDateEdit @bind-Date="@DateOffset" TimeSectionVisible="true"/>
@code {
DateTimeOffset DateOffset { get; set; } = DateTimeOffset.Now;
}
This functionality affects your application in the following cases:
Your component’s Date property is bound to a DateTimeOffset or nullable < DateTimeOffset> object.
You do not allow a user to edit the Offset part of DateTimeOffset values. Note that the Offset part is editable when the component’s Mask or Format property value is
O
oro
,R
orr
, or containsz
.
Note
When the Date Edit component converts DateTimeOffset values to the client’s time zone, the DateChanged event does not fire.
In previous versions, the component displayed DateTimeOffset values without conversion to the client’s time zone.
Use the IgnoreClientDateTimeOffsetInDateEdit
property to restore this behavior. Specify this property in the Program.cs file before you register DevExpress resources:
// ...
DevExpress.Blazor.CompatibilitySettings.IgnoreClientDateTimeOffsetInDateEdit = true;
builder.Services.AddDevExpressBlazor();
// ...
app.Run();