Repository navigation
Conversation
Add the igxCalendarDay directive and the dayTemplate input to customize the content of the calendar day cells. The template receives the date and the day states through IgxCalendarDayTemplateContext, while the cells keep their selection, keyboard navigation, ARIA and styling. The date picker and date range picker pass the template to their calendar. Closes #17822 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Template context values need correction, and both picker import collections must expose the new directive.
3 open issues
What changed in this PR
Adds customizable calendar day content for #17822, with typed date and state context and integration into both date pickers.
Changes:
- Introduces
igxCalendarDayanddayTemplatewhile retaining existing cell interaction and styling. - Adds calendar behavior tests and picker integration tests.
- Documents the API and adds event-indicator and pricing samples.
| File | Description |
|---|---|
| src/app/calendar/calendar.sample.ts | Adds template directive imports and sample data helpers. |
| src/app/calendar/calendar.sample.scss | Styles event indicators and prices. |
| src/app/calendar/calendar.sample.html | Demonstrates calendar and range-picker templates. |
| skills/igniteui-angular-components/references/form-controls.md | Documents template usage and constraints. |
| projects/igniteui-angular/date-picker/src/date-range-picker/date-range-picker.component.ts | Forwards projected day templates to the calendar. |
| projects/igniteui-angular/date-picker/src/date-range-picker/date-range-picker.component.spec.ts | Tests range-picker template rendering. |
| projects/igniteui-angular/date-picker/src/date-picker/date-picker.component.ts | Forwards projected day templates to the calendar. |
| projects/igniteui-angular/date-picker/src/date-picker/date-picker.component.spec.ts | Tests date-picker template rendering. |
| projects/igniteui-angular/calendar/src/calendar/public_api.ts | Adds the directive to the calendar import collection. |
| projects/igniteui-angular/calendar/src/calendar/days-view/days-view.component.ts | Accepts a typed day template. |
| projects/igniteui-angular/calendar/src/calendar/days-view/days-view.component.html | Renders custom content for visible days. |
| projects/igniteui-angular/calendar/src/calendar/days-view/day-item.component.ts | Builds the date and state context. |
| projects/igniteui-angular/calendar/src/calendar/calendar.directives.ts | Defines the directive and typed context. |
| projects/igniteui-angular/calendar/src/calendar/calendar.component.ts | Resolves input and projected templates. |
| projects/igniteui-angular/calendar/src/calendar/calendar.component.spec.ts | Tests context, interaction, precedence, and multiple views. |
| projects/igniteui-angular/calendar/src/calendar/calendar.component.html | Passes the template to each days view. |
| projects/igniteui-angular/calendar/README.md | Documents the API, context, and accessibility constraints. |
| CHANGELOG.md | Announces day-template support. |
Review effort: Balanced
| $implicit: this.date.native, | ||
| date: this.date.native, | ||
| formattedDate, | ||
| selected: this.isSelectedCSS, |
| active: this.isActive, | ||
| firstInRange: this.isFirstInRange, | ||
| lastInRange: this.isLastInRange, | ||
| withinRange: this.isWithinRange, |
Comment on lines
+441
to
+442
| @ContentChild(IgxCalendarDayTemplateDirective, { read: TemplateRef }) | ||
| private dayTemplate?: TemplateRef<IgxCalendarDayTemplateContext>; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #17822
Description
Add the igxCalendarDay directive and the dayTemplate input to customize the content of the calendar day cells. The template receives the date and the day states through IgxCalendarDayTemplateContext, while the cells keep their selection, keyboard navigation, ARIA and styling. The date picker and date range picker pass the template to their calendar.
Motivation / Context
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
How Has This Been Tested?
Test Configuration:
Screenshots / Recordings
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)