You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Blazor WASM hosted on Azure. There i have a DatePicker defined as follows:
<DatePicker @bind-Value="@context.Date" AllowClear="false" DisabledDate="date => date <= NextValidDate" />
The Date in the model that is bound is a simple
public DateTime Date { get; set; } = DateTime.Today;
When I now open the view with the DatePicker and click okey, the actually selected date is off by 1 hour. With that the date is no longer for example 09.02.2021 00:00 but 08.02.2021 23:00.
Funny enough, as soon as I select a date (for example when I just click on the "Today" in the date flyout it is correctly selected. Also I tried to replace the ANT DatePicker with the default Blazor and with that the behaviour is correct.
Also important to note, is that it only happens when I deploy to azure. When I start in debug locally it works as expected as well.
My guess is, that it has something todo with the way ant handles the culture internally vs blazor handles the date which in turn causes the time offset.
Has anyone of you experienced something similar or any idea what causes that?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a Blazor WASM hosted on Azure. There i have a DatePicker defined as follows:
The Date in the model that is bound is a simple
When I now open the view with the DatePicker and click okey, the actually selected date is off by 1 hour. With that the date is no longer for example
09.02.2021 00:00
but08.02.2021 23:00
.Funny enough, as soon as I select a date (for example when I just click on the "Today" in the date flyout it is correctly selected. Also I tried to replace the ANT DatePicker with the default Blazor and with that the behaviour is correct.
Also important to note, is that it only happens when I deploy to azure. When I start in debug locally it works as expected as well.
My guess is, that it has something todo with the way ant handles the culture internally vs blazor handles the date which in turn causes the time offset.
Has anyone of you experienced something similar or any idea what causes that?
Beta Was this translation helpful? Give feedback.
All reactions