I have a Blazor server app hosted on Azure, which uses UTC time.
I'm using Syncfusion.Blazor.Schedule v24.2.6
Per examples, I use this attribute in my SfSchedule declaration: @bind-SelectedDate="@CurrentDate"
And I have this property in the @code section: public DateTime CurrentDate { get; set; }
In OnAfterRenderAsync, I calculate the desired 'today' for my user's timezone, which is UTC-8.
TimeZoneInfo pacificZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
DateTime dtLocalTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.SpecifyKind(DateTime.UtcNow, DateTimeKind.Utc), pacificZone);
And I then assign it to the property to which the scheduler
SelectedDate is bound.
CurrentDate = dtLocalTime;
This works when run locally, but when run on Azure I see that it is always using UtCNow as the date. It seems to ignore the value I assign to the
CurrentDate property which is based on desired viewing timezone.
This isn't obvious as it only manifests itself when UTC becomes 'tomorrow' which is 8 hours sooner than local time, so the scheduler is showing 'today' as the wrong date, it is showing tomorrow instead.
Notably the
scheduler
has a feature where you can navigate to 'Today' using its own internal logic. I believe that it is using this same logic to indicate the current date, and ignoring my value.
Am I missing something here? At this point its seems like a bug in the scheduler.
Since I can't control this, I tried to hide the visual indication, by overriding the observed CSS (in dev tools) for this feature, but that didn't seem to work.
This is kind of a prominent and embarrassing bug I don't know how to fix.
Thanks in advance for any comments.