@if (Scheduler.DayTemplate != null)
{
@Scheduler.DayTemplate(Day)
diff --git a/BlazorScheduler/Internal/Components/SchedulerWeek.razor b/BlazorScheduler/Internal/Components/SchedulerWeek.razor
index 14c1b13..ce7d3d5 100644
--- a/BlazorScheduler/Internal/Components/SchedulerWeek.razor
+++ b/BlazorScheduler/Internal/Components/SchedulerWeek.razor
@@ -1,10 +1,10 @@
@namespace BlazorScheduler.Internal.Components
-
+
@for (var dt = Start; dt <= End; dt = dt.AddDays(1))
{
-
+
}
@@ -39,7 +39,7 @@
AppointmentCount="numOverFlowAppointments"
Start="(dt.DayOfWeek - Scheduler.StartDayOfWeek + 7) % 7"
Order="MaxNumOfAppointmentsPerDay"
- @key="dt" />
+ @key="dt" Style="@Scheduler.RootAppointmentOverflowStyle" />
}
}
diff --git a/BlazorScheduler/wwwroot/css/styles.css b/BlazorScheduler/wwwroot/css/styles.css
index 1ecc26d..bc42219 100644
--- a/BlazorScheduler/wwwroot/css/styles.css
+++ b/BlazorScheduler/wwwroot/css/styles.css
@@ -65,7 +65,7 @@
.scheduler > .month > .week > .days {
display: flex;
justify-content: space-around;
- height: max(8.313rem, calc(1.5rem + 5px + 8px + var(--maxAppointments) * 1.2rem));
+ height: max(8.313rem, calc(1.5rem + 5px + 8px + var(--maxAppointments) * 1.5rem));
}
.scheduler > .month > .week.header {
@@ -120,12 +120,12 @@
.scheduler > .month > .week > .appointments > .appointment {
position: absolute;
left: calc(var(--start) / 7 * 100%);
- top: max(10px, calc(15px + (var(--order) * 1.2rem)));
+ top: max(10px, calc(15px + (var(--order) * 1.5rem)));
border-radius: 2px;
margin-left: 2px;
width: calc((var(--end) - var(--start) + 1) / 7 * 100% - 4px);
padding-left: 4px;
- font-size: .75rem;
+ font-size: .95rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
diff --git a/DemoApp/AppointmentService.cs b/DemoApp/AppointmentService.cs
index 740b33e..f5d179b 100644
--- a/DemoApp/AppointmentService.cs
+++ b/DemoApp/AppointmentService.cs
@@ -15,7 +15,7 @@ public IEnumerable
GetAppointments(DateTime start, DateTime end)
private readonly List AllAppointments = new()
{
- new AppointmentDto { Title = "Hello 1", Start = DateTime.Now, End = DateTime.Now.AddHours(1), Color = "yellow" },
+ new AppointmentDto { Title = "Hello 1", Start = DateTime.Now, End = DateTime.Now.AddHours(1), Color = "yellow", Class = "bg-dark text-white"},
new AppointmentDto { Title = "Hello 2", Start = DateTime.Now.AddDays(3), End = DateTime.Now.AddDays(3).AddHours(1), Color = "red" },
new AppointmentDto { Title = "Hello 3", Start = DateTime.Today, End = DateTime.Today.AddDays(1), Color = "yellow" },
diff --git a/DemoApp/Models/AppointmentDto.cs b/DemoApp/Models/AppointmentDto.cs
index 6e3e9af..a1e6344 100644
--- a/DemoApp/Models/AppointmentDto.cs
+++ b/DemoApp/Models/AppointmentDto.cs
@@ -8,5 +8,6 @@ public class AppointmentDto
public DateTime Start { get; set; }
public DateTime End { get; set; }
public string Color { get; set; }
+ public string? Class { get; set; }
}
}
diff --git a/DemoApp/Pages/Basic.razor b/DemoApp/Pages/Basic.razor
index 63ca9a4..0d7c42f 100644
--- a/DemoApp/Pages/Basic.razor
+++ b/DemoApp/Pages/Basic.razor
@@ -5,7 +5,7 @@
@foreach (var app in _appointments)
{
-
+
@app.Title
@if (context.IsTimed)
{
diff --git a/DemoApp/Pages/Configuration.razor b/DemoApp/Pages/Configuration.razor
index b084588..a619bd3 100644
--- a/DemoApp/Pages/Configuration.razor
+++ b/DemoApp/Pages/Configuration.razor
@@ -43,6 +43,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Add appointments
Clear appointments
@@ -63,11 +81,14 @@
TodayButtonText="@_todayButtonText"
PlusOthersText="@_plusOthersText"
NewAppointmentText="@_newAppointmentText"
- EnableAppointmentsCreationFromScheduler="@_enableAppCreationFromScheduler">
+ EnableAppointmentsCreationFromScheduler="@_enableAppCreationFromScheduler"
+ RootDaysGroupInWeekStyle="@_rootDaysGroupInWeekStyles"
+ RootAppointmentOverflowStyle="@_rootAppointmentOverflowStyle"
+ RootDayClass="@_rootDayClass" RootDayStyle="@_rootDayStyle">
@foreach (var app in _appointments)
{
-
+
@app.Title
}
@@ -89,7 +110,14 @@
private string _todayButtonText = "Today";
private string _plusOthersText = "+ {n} others";
private string _newAppointmentText = "New Appointment";
-
+
+ private string _classes = "";
+ private string _styles = "";
+ private string _rootDaysGroupInWeekStyles = "";
+ private string _rootAppointmentOverflowStyle = "";
+ private string _rootDayClass = "";
+ private string _rootDayStyle = "";
+
Task OnAddingNewAppointment(DateTime start, DateTime end)
{
_appointments.Add(new AppointmentDto { Start = start, End = end, Title = "A newly added appointment!", Color = "aqua" });