DayScheduleManager
in package
DayScheduleManager - Daily Schedule Manager
Generates daily views with detailed vertical timeline (08:00-20:00) and course blocks positioned according to their schedule.
Tags
Table of Contents
Constants
- END_HOUR = 20
- End hour of the day (20:00)
- START_HOUR = 8
- Start hour of the day (08:00)
Methods
-
generateDaySchedule()
: array{date: string, dayName: string, formatted: string, events: array
>, prevDate: string, nextDate: string, hours: array , currentTime: array{hour: int, minute: int, top: int}|null} - Generates the complete structure of a daily schedule
- getTimeRange() : array{start: int, end: int}
- Gets the timeline time range
- calculateCurrentTimePosition() : array{hour: int, minute: int, top: int}
- Calculates the current time position
- calculateEventPosition() : array{top: string, height: string}
- Calculates the CSS position and height of an event
- filterAndPositionEvents() : array<int, array<string, mixed>>
- Filters and positions events for a specific day
- getFrenchDayName() : string
- Gets the French name of the day of the week
Constants
END_HOUR
End hour of the day (20:00)
private
mixed
END_HOUR
= 20
START_HOUR
Start hour of the day (08:00)
private
mixed
START_HOUR
= 8
Methods
generateDaySchedule()
Generates the complete structure of a daily schedule
public
generateDaySchedule(string $date[, array<int, array<string, mixed>> $events = [] ]) : array{date: string, dayName: string, formatted: string, events: array>, prevDate: string, nextDate: string, hours: array, currentTime: array{hour: int, minute: int, top: int}|null}
Parameters
- $date : string
-
Date in 'Y-m-d' format
- $events : array<int, array<string, mixed>> = []
-
List of events for the day
Return values
array{date: string, dayName: string, formatted: string, events: arraygetTimeRange()
Gets the timeline time range
public
getTimeRange() : array{start: int, end: int}
Return values
array{start: int, end: int}calculateCurrentTimePosition()
Calculates the current time position
private
calculateCurrentTimePosition() : array{hour: int, minute: int, top: int}
Return values
array{hour: int, minute: int, top: int}calculateEventPosition()
Calculates the CSS position and height of an event
private
calculateEventPosition(string $startTime, string $endTime) : array{top: string, height: string}
Parameters
- $startTime : string
-
Start time
- $endTime : string
-
End time
Return values
array{top: string, height: string}filterAndPositionEvents()
Filters and positions events for a specific day
private
filterAndPositionEvents(array<int, array<string, mixed>> $events, string $targetDate) : array<int, array<string, mixed>>
Parameters
- $events : array<int, array<string, mixed>>
-
All events
- $targetDate : string
-
Target date
Return values
array<int, array<string, mixed>>getFrenchDayName()
Gets the French name of the day of the week
private
getFrenchDayName(string|int $dayNumber) : string
Parameters
- $dayNumber : string|int
-
The day (1-7, 1=Monday)