is it possible to change the slot background or style of day text in monthview ?
Hi @Satroki,
At the moment this isn't possible. We will add support for this in some of the future releases.
No, there is no new development in this regard. This feature is still not implemented.
We would appreciate this too.
We are looking forward to having this feature as well.
Any update on this feature?
The online demo shows how to do that.
void OnSlotRender(SchedulerSlotRenderEventArgs args)
{
// Highlight today in month view
if (args.View.Text == "Month" && args.Start.Date == DateTime.Today)
{
args.Attributes["style"] = "background: rgba(255,220,40,.2);";
}
}
When hosting app in Azure the times are off. It also affects clicking on the Today button. Depending on the time of the day when I click the today button the date takes me to the following day.
The snippet below also sometimes will highlight the following day depending on the time of the day. I know it has something to do with UTC values.
if (args.View.Text == "Month" && args.Start.Date == DateTime.Today)
{
args.Attributes["style"] = "background: rgba(255,220,40,.2);";
}
is there a way to access or modify what the Today button click does?
It's now Sunday 5/19/2024 10:21pm ET. I click on the Today button it says it's Monday 5/20/2024 when in the day view.
If you are having a Blazor server application the server time would be used when rendering blazor components. You can test it by outputting @DateTime.Today
in some of your pages.
This will be an issue for anyone hosting in Azure unless the component allows access to this property we can't convert that time from UTC.
You can try setting the Date attribute of your scheduler. It is set to DateTime.Today
by default.
not sure if its the same issue but for the UK we had to add code to program.cs to set CultureInfo.DefaultThreadCurrentCulture and CultureInfo.DefaultThreadCurrentUICulture
I've tried setting it in the component and it didn't change anything. Date is still a day later
<RadzenScheduler Date=@(TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, Zone)) ....
It's now 5/24/2024 8:27pm ET Time but it shows 5/25/2024 When I click Today button.
Setting the Date
attribute sets the current date. Doesn't this work as needed? Clicking the Today button would still use DateTime.Now.Date: radzen-blazor/Radzen.Blazor/RadzenScheduler.razor.cs at master · radzenhq/radzen-blazor · GitHub
Let me know if things work as expected before clicking Today.
Yes before clicking the Today button the date is fine. Going to the Day view shows the correct date but when you click Today the wrong date comes up.
If clicking Today button still uses DateTime.Now.Date that would probably explain it. How can I get access to that so that I can convert the date from UTC when clicking that button? Azure server is always UTC so DateTime.Now.Date will be UTC date.
I've just pushed a new event that would allow you to do that. Will ship some time next week.
Great news! Thank you!