refactor(calendar): encapsulate calendar projection and selection ranges
CalendarService.project returns the covered months together with the projected selections, so month enumeration and selected-day rendering share one projection horizon. SelectedDates is built once from the complete range list and groups connected periods internally, exposing read-only selection, boundary and day-type queries. In declaration entry, months reached by adjacent declared or non-working days are now shown, matching the projected selections. Refs #276 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5cb0b93339
commit
502d561f6f
5 files changed
+268
-407
No files matched your search
@@ -184,14 +184,10 @@ export class CalendarMonth implements OnInit {
|
||||
|
||||
getDayTooltip(day: Date): string | null {
|
||||
const previewed = this.declarationPreview?.dates.has(this.getDateKey(day));
|
||||
const tooltips: string[] = this.selectedDates.datesSelected
|
||||
.filter(
|
||||
(dateSelected) =>
|
||||
dateSelected.isSelected(day) &&
|
||||
dateSelected.type &&
|
||||
(!previewed || !['cp', 'rtt', 'other'].includes(dateSelected.type)),
|
||||
)
|
||||
.map((dateSelected) => this.translationService.getDayTypeLabel(dateSelected.type!));
|
||||
const tooltips: string[] = this.selectedDates
|
||||
.dayTypes(day)
|
||||
.filter((type) => !previewed || !['cp', 'rtt', 'other'].includes(type))
|
||||
.map((type) => this.translationService.getDayTypeLabel(type));
|
||||
const declaredType = this.getDeclaredType(this.getDateKey(day));
|
||||
if (declaredType)
|
||||
tooltips.push(
|
||||
|
||||
Reference in new issue
Block a user