Improves calendar event rendering and data
Updates mock event data to reflect a more recent week and includes events spanning early/late hours. Enhances event rendering by adjusting the top and height styles for better visual appearance. Refactors CSS to improve grid line display and event hover effects, and moves hour marker styles to a more appropriate CSS file. Provides default fallback values for time boundaries using CSS variables.
This commit is contained in:
parent
28ed131b9e
commit
5a686da7f5
8 changed files with 74 additions and 61 deletions
|
|
@ -27,8 +27,8 @@ export class CalendarConfig {
|
|||
firstDayOfWeek: 1, // 0 = Sunday, 1 = Monday
|
||||
|
||||
// Time settings
|
||||
dayStartHour: 0, // Calendar starts at midnight
|
||||
dayEndHour: 24, // Calendar ends at midnight (24 hours)
|
||||
dayStartHour: 0, // Calendar starts at midnight (default)
|
||||
dayEndHour: 24, // Calendar ends at midnight (default)
|
||||
workStartHour: 8, // Work hours start
|
||||
workEndHour: 17, // Work hours end
|
||||
snapInterval: 15, // Minutes: 5, 10, 15, 30, 60
|
||||
|
|
|
|||
|
|
@ -33,23 +33,23 @@ export class EventManager {
|
|||
private loadMockData(): void {
|
||||
// Mock events for current week (July 27 - August 2, 2025)
|
||||
this.events = [
|
||||
// Sunday July 27, 2025
|
||||
// Sunday August 3, 2025
|
||||
{
|
||||
id: '1',
|
||||
title: 'Weekend Planning',
|
||||
start: '2025-07-27T10:00:00',
|
||||
end: '2025-07-27T11:00:00',
|
||||
start: '2025-08-03T10:00:00',
|
||||
end: '2025-08-03T11:00:00',
|
||||
type: 'work',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
metadata: { duration: 60 }
|
||||
},
|
||||
// Monday July 28, 2025
|
||||
// Monday August 4, 2025
|
||||
{
|
||||
id: '2',
|
||||
title: 'Team Standup',
|
||||
start: '2025-07-28T09:00:00',
|
||||
end: '2025-07-28T09:30:00',
|
||||
start: '2025-08-04T09:00:00',
|
||||
end: '2025-08-04T09:30:00',
|
||||
type: 'meeting',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
|
|
@ -58,19 +58,19 @@ export class EventManager {
|
|||
{
|
||||
id: '3',
|
||||
title: 'Project Kickoff',
|
||||
start: '2025-07-28T14:00:00',
|
||||
end: '2025-07-28T15:30:00',
|
||||
start: '2025-08-04T14:00:00',
|
||||
end: '2025-08-04T15:30:00',
|
||||
type: 'meeting',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
metadata: { duration: 90 }
|
||||
},
|
||||
// Tuesday July 29, 2025
|
||||
// Tuesday August 5, 2025
|
||||
{
|
||||
id: '4',
|
||||
title: 'Deep Work Session',
|
||||
start: '2025-07-29T10:00:00',
|
||||
end: '2025-07-29T12:00:00',
|
||||
start: '2025-08-05T10:00:00',
|
||||
end: '2025-08-05T12:00:00',
|
||||
type: 'work',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
|
|
@ -79,30 +79,30 @@ export class EventManager {
|
|||
{
|
||||
id: '5',
|
||||
title: 'Lunch Meeting',
|
||||
start: '2025-07-29T12:30:00',
|
||||
end: '2025-07-29T13:30:00',
|
||||
start: '2025-08-05T12:30:00',
|
||||
end: '2025-08-05T13:30:00',
|
||||
type: 'meal',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
metadata: { duration: 60 }
|
||||
},
|
||||
// Wednesday July 30, 2025
|
||||
// Wednesday August 6, 2025
|
||||
{
|
||||
id: '6',
|
||||
title: 'Client Review',
|
||||
start: '2025-07-30T15:00:00',
|
||||
end: '2025-07-30T16:00:00',
|
||||
start: '2025-08-06T15:00:00',
|
||||
end: '2025-08-06T16:00:00',
|
||||
type: 'meeting',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
metadata: { duration: 60 }
|
||||
},
|
||||
// Thursday July 31, 2025
|
||||
// Thursday August 7, 2025
|
||||
{
|
||||
id: '7',
|
||||
title: 'Sprint Planning',
|
||||
start: '2025-07-31T09:00:00',
|
||||
end: '2025-07-31T10:30:00',
|
||||
start: '2025-08-07T09:00:00',
|
||||
end: '2025-08-07T10:30:00',
|
||||
type: 'meeting',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
|
|
@ -111,19 +111,19 @@ export class EventManager {
|
|||
{
|
||||
id: '8',
|
||||
title: 'Code Review',
|
||||
start: '2025-07-31T14:00:00',
|
||||
end: '2025-07-31T15:00:00',
|
||||
start: '2025-08-07T14:00:00',
|
||||
end: '2025-08-07T15:00:00',
|
||||
type: 'work',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
metadata: { duration: 60 }
|
||||
},
|
||||
// Friday August 1, 2025
|
||||
// Friday August 8, 2025
|
||||
{
|
||||
id: '9',
|
||||
title: 'Team Standup',
|
||||
start: '2025-08-01T09:00:00',
|
||||
end: '2025-08-01T09:30:00',
|
||||
start: '2025-08-08T09:00:00',
|
||||
end: '2025-08-08T09:30:00',
|
||||
type: 'meeting',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
|
|
@ -132,19 +132,50 @@ export class EventManager {
|
|||
{
|
||||
id: '10',
|
||||
title: 'Client Meeting',
|
||||
start: '2025-08-01T14:00:00',
|
||||
end: '2025-08-01T15:30:00',
|
||||
start: '2025-08-08T14:00:00',
|
||||
end: '2025-08-08T15:30:00',
|
||||
type: 'meeting',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
metadata: { duration: 90 }
|
||||
},
|
||||
// Saturday August 2, 2025
|
||||
// Saturday August 9, 2025
|
||||
{
|
||||
id: '11',
|
||||
title: 'Weekend Project',
|
||||
start: '2025-08-02T10:00:00',
|
||||
end: '2025-08-02T12:00:00',
|
||||
start: '2025-08-09T10:00:00',
|
||||
end: '2025-08-09T12:00:00',
|
||||
type: 'work',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
metadata: { duration: 120 }
|
||||
},
|
||||
// Test events for early/late hours
|
||||
{
|
||||
id: '12',
|
||||
title: 'Early Morning Workout',
|
||||
start: '2025-08-05T06:00:00',
|
||||
end: '2025-08-05T07:00:00',
|
||||
type: 'work',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
metadata: { duration: 60 }
|
||||
},
|
||||
{
|
||||
id: '13',
|
||||
title: 'Late Evening Call',
|
||||
start: '2025-08-06T21:00:00',
|
||||
end: '2025-08-06T22:00:00',
|
||||
type: 'meeting',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
metadata: { duration: 60 }
|
||||
},
|
||||
{
|
||||
id: '14',
|
||||
title: 'Midnight Deployment',
|
||||
start: '2025-08-07T23:00:00',
|
||||
end: '2025-08-08T01:00:00',
|
||||
type: 'work',
|
||||
allDay: false,
|
||||
syncStatus: 'synced',
|
||||
|
|
|
|||
|
|
@ -133,8 +133,8 @@ export class EventRenderer {
|
|||
// Calculate position based on time
|
||||
const position = this.calculateEventPosition(event);
|
||||
eventElement.style.position = 'absolute';
|
||||
eventElement.style.top = `${position.top}px`;
|
||||
eventElement.style.height = `${position.height}px`;
|
||||
eventElement.style.top = `${position.top + 1}px`;
|
||||
eventElement.style.height = `${position.height - 1}px`;
|
||||
eventElement.style.left = '2px';
|
||||
eventElement.style.right = '2px';
|
||||
eventElement.style.zIndex = '10';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue