Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DaySelect event to Day, Week and Month Views #1910

Merged
merged 4 commits into from
Jan 27, 2025

Conversation

paulo-rico
Copy link
Contributor

Similar to the MonthSelect on the various Year Views, this will raise a SelectDay event on a click of the Day Header (Day and Week View) or the Day Number (Month View).

Additional

Also in this PR, I had to change a line in the OnKeyPress event in DayView.razor.

`currentAppointments = AppointmentsInSlot(CurrentDate, CurrentDate.AddDays(1));`

This was taking the CurrentDate, which includes the StartTime and setting the range to CurrentDate.AddDays(1). This resulted in (using default StartTime value) from 08:00 one day to to 08:00 the next day. All other range calculations are based on actual start of day to end of day.

Radzen.Blazor/RadzenScheduler.razor.cs Show resolved Hide resolved
Radzen.Blazor/Rendering/DayView.razor Outdated Show resolved Hide resolved
Radzen.Blazor/Rendering/DayView.razor Outdated Show resolved Hide resolved
Radzen.Blazor/Rendering/MonthView.razor Outdated Show resolved Hide resolved
Radzen.Blazor/Rendering/WeekView.razor Outdated Show resolved Hide resolved
RadzenBlazorDemos/Pages/SchedulerConfig.razor Outdated Show resolved Hide resolved
RadzenBlazorDemos/Pages/SchedulerConfig.razor Outdated Show resolved Hide resolved
Radzen.Blazor/SchedulerDaySelectEventArgs.cs Outdated Show resolved Hide resolved
Radzen.Blazor/RadzenScheduler.razor.cs Show resolved Hide resolved
@paulo-rico
Copy link
Contributor Author

Hi @akorchev

I've sent in another commit to resolve these issues a few days ago. Is there something else I need to be doing to this PR to move it along?

@@ -125,6 +125,11 @@
await Scheduler.SelectSlot(date, date.AddDays(1), AppointmentsInSlot(date, date.AddDays(1)));
}

async Task OnDayClick(DateTime day)
{
await Scheduler.SelectDay(day, AppointmentsInSlot(day.Date, day.Date.AddHours(23).AddMinutes(59).AddSeconds(59)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still feels wrong. Why are you doing it like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. It's should be as simple as

await Scheduler.SelectDay(day, AppointmentsInSlot(day, day.AddDays(1)));

Is this better?

@akorchev akorchev merged commit e870ca8 into radzenhq:master Jan 27, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants