Skip to content

feat(calendar): add day template - #17846

Open
teodosiah wants to merge 3 commits into
masterfrom
thristodorova/feat-17822-calendar-day-template
Open

teodosiah wants to merge 3 commits into
masterfrom
thristodorova/feat-17822-calendar-day-template

Conversation

@teodosiah

Copy link
Copy Markdown
Contributor

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):

  • Bug fix
  • New functionality
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Documentation
  • Demos
  • CI/CD
  • Tests
  • Changelog
  • Skills/Agents

Component(s) / Area(s) Affected:

How Has This Been Tested?

  • Unit tests
  • Manual testing
  • Automated e2e tests

Test Configuration:

  • Angular version:
  • Browser(s):
  • OS:

Screenshots / Recordings

Checklist:

  • All relevant labels have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them
  • Accessibility (ARIA, keyboard navigation, focus management) has been verified

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>
Copilot AI balanced review requested due to automatic review settings October 23, 2026 11:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 igxCalendarDay and dayTemplate while 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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Calendar] Support custom day cell templates

2 participants