Skip to main content
A newer version of this page is available. .
All docs
V23.1

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

true to display values without conversion to the client’s time zone; false to convert values based on the client’s time zone offset.

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;
}

Run Demo

This functionality affects your application in the following cases:

  1. Your component’s Date property is bound to a DateTimeOffset or nullable < DateTimeOffset> object.

  2. 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 or o, R or r, or contains z.

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();
See Also