Files
poprhythm 46836fde2e Refactor Calendar component to adjust default meeting times and improve event item styling
This commit updates the Calendar component by changing the default start time for meetings to 9:00 AM and the end time to 5:01 PM, ensuring better alignment with typical work hours. Additionally, the styling of calendar event items is refined by removing fixed width and height properties, allowing for more flexible rendering. These changes enhance the usability and visual presentation of the calendar feature, contributing to an improved user experience.
2026-01-26 22:15:03 -05:00

39 lines
1.3 KiB
C#

using Core.Entities;
using Heron.MudCalendar;
namespace WebApp.Models;
/// <summary>
/// Calendar meeting item model for Heron.MudCalendar component.
/// Maps from TeamMeetingHistory entity to calendar event format.
/// </summary>
public class CalendarMeetingItem : CalendarItem
{
/// <summary>
/// Gets the original TeamMeetingHistory data.
/// </summary>
public TeamMeetingHistory? MeetingHistoryData { get; set; }
/// <summary>
/// Parameterless constructor required by Heron.MudCalendar component.
/// </summary>
public CalendarMeetingItem()
{
// Initialize base class properties to avoid null reference issues
Text = string.Empty;
Start = DateTime.MinValue;
End = DateTime.MinValue;
}
public CalendarMeetingItem(TeamMeetingHistory meetingHistory)
{
MeetingHistoryData = meetingHistory;
// Set base class properties that the calendar component uses
Text = "Team Meeting";
// Set start to 9:00 AM on the meeting date
Start = meetingHistory.MeetingDate.Date.AddHours(9);
// Set end to 5:00 PM on the meeting date (5:01 PM to ensure it displays until 5pm if end is exclusive)
End = meetingHistory.MeetingDate.Date.AddHours(17).AddMinutes(1);
}
}