/syncfusion-angular:syncfusion-angular-calendarsfrom Syncfusion Angular UI Components
Comprehensive guide for implementing Syncfusion Angular Calendar components including Calendar, DatePicker, DateRangePicker, DateTimePicker, and TimePicker. Covers installation, data binding, date/time selection, range selection, formatting, localization, masking, validation, customization, templates, accessibility, and controlled component patterns in Angular applications.
Ships in Syncfusion Angular UI Components. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A comprehensive guide for implementing the Syncfusion Essential JS 2 Calendar component in Angular applications. Learn to create date pickers, manage calendar views, handle events, and customize styling.
The Syncfusion Angular Calendar component is a date selection widget that provides:
isMultiSelection propertynavigateTo() method for programmatic view switchingaddDate() and removeDate() for multi-selection managementPackage: @syncfusion/ej2-angular-calendars
Read the following references based on your specific needs:
📄 Read: references/getting-started.md
📄 Read: references/calendar-views.md
start property usagedepth property for restricting views📄 Read: references/date-selection.md
isMultiSelection)value property for single datesvalues array for multiple dates📄 Read: references/events-and-methods.md
addDate() method for multi-selectionremoveDate() method for multi-selectionnavigateTo() for programmatic navigationcurrentView() to get active viewgetPersistData() to retrieve persistence datadestroy() to destroy the calendar widget📄 Read: references/calendar-navigation.md
showTodayButton)firstDayOfWeek propertyweekNumber)📄 Read: references/accessibility-and-globalization.md
📄 Read: references/styling-and-customization.md
📄 Read: references/api-reference.md
// app.component.ts
import { Component } from '@angular/core';
import { ChangedEventArgs } from '@syncfusion/ej2-calendars';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
// Single date selection
selectedDate: Date = new Date();
// Multiple date selection
selectedDates: Date[] = [
new Date(2026, 2, 15),
new Date(2026, 2, 20),
new Date(2026, 2, 25)
];
// Calendar configuration
minDate: Date = new Date(2020, 0, 1);
maxDate: Date = new Date(2030, 11, 31);
// Event handler
onCalendarChange(args: ChangedEventArgs): void {
console.log('Selected date:', args.value);
}
}
<!-- app.component.html -->
<div style="padding: 20px; font-family: Arial, sans-serif;">
<h2>Single Date Selection</h2>
<ejs-calendar
[(ngModel)]="selectedDate"
[min]="minDate"
[max]="maxDate"
(change)="onCalendarChange($event)">
</ejs-calendar>
<p>Selected: {{ selectedDate | date:'medium' }}</p>
<h2>Multiple Date Selection</h2>
<ejs-calendar
[(ngModel)]="selectedDates"
[isMultiSelection]="true"
[showTodayButton]="true">
</ejs-calendar>
<p>Selected dates: {{ selectedDates.length }} dates</p>
</div>
/* app.component.css */
@import '../node_modules/@syncfusion/ej2-base/styles/material3.css';
@import '../node_modules/@syncfusion/ej2-calendars/styles/material3.css';
:host ::ng-deep .e-calendar {
margin: 20px 0;
}
:host ::ng-deep .e-selected {
background-color: #3f51b5;
color: white;
}
The Calendar component does not have built-in range selection. Use two separate Calendar instances with min/max constraints and the change event to implement a custom date range picker:
export class AppComponent {
startDate: Date = new Date();
endDate: Date = new Date();
onStartDateChange(args: ChangedEventArgs): void {
this.startDate = args.value;
// Ensure end date is not before start date
if (this.endDate < this.startDate) {
this.endDate = this.startDate;
}
}
onEndDateChange(args: ChangedEventArgs): void {
this.endDate = args.value;
}
getDaysInRange(): number {
const timeDiff = this.endDate.getTime() - this.startDate.getTime();
return Math.ceil(timeDiff / (1000 * 3600 * 24)) + 1;
}
}
<!-- Two separate Calendar instances for range selection -->
<ejs-calendar [(ngModel)]="startDate" (change)="onStartDateChange($event)"></ejs-calendar>
<ejs-calendar [(ngModel)]="endDate" [min]="startDate" (change)="onEndDateChange($event)"></ejs-calendar>
Disable specific dates (weekends, holidays) using renderDayCell event:
export class AppComponent {
holidays: Date[] = [
new Date(2026, 11, 25), // Christmas
new Date(2026, 0, 1), // New Year
];
onRenderDayCell(args: RenderDayCellEventArgs): void {
// Disable weekends
if (args.date.getDay() === 0 || args.date.getDay() === 6) {
args.isDisabled = true;
}
// Disable holidays
if (this.isHoliday(args.date)) {
args.isDisabled = true;
}
}
private isHoliday(date: Date): boolean {
return this.holidays.some(holiday =>
holiday.toDateString() === date.toDateString()
);
}
}
Manage multiple selected dates programmatically:
export class AppComponent {
@ViewChild('calendar') calendarRef!: CalendarComponent;
selectedDates: Date[] = [];
addDateToSelection(date: Date): void {
// Check if already selected
if (!this.selectedDates.some(d =>
d.toDateString() === date.toDateString())) {
this.calendarRef.addDate(date);
}
}
removeDateFromSelection(date: Date): void {
this.calendarRef.removeDate(date);
}
clearAllDates(): void {
if (this.selectedDates.length > 0) {
this.calendarRef.removeDate(this.selectedDates);
}
}
}
Implement navigation to different calendar views:
export class AppComponent {
@ViewChild('calendar') calendarRef!: CalendarComponent;
navigateToYear(year: number): void {
const dateInYear = new Date(year, 0, 1);
this.calendarRef.navigateTo('Year', dateInYear);
}
navigateToDecade(startYear: number): void {
const dateInDecade = new Date(startYear, 0, 1);
this.calendarRef.navigateTo('Decade', dateInDecade);
}
getCurrentView(): string {
return this.calendarRef.currentView();
}
}
Integrate Calendar with Angular Reactive Forms:
export class AppComponent implements OnInit {
dateForm: FormGroup;
constructor(private fb: FormBuilder) {
this.dateForm = this.fb.group({
eventDate: [new Date(), Validators.required],
eventName: ['', Validators.required]
});
}
ngOnInit(): void {
// Subscribe to date changes
this.dateForm.get('eventDate')?.valueChanges.subscribe(date => {
console.log('Event date changed:', date);
});
}
submitForm(): void {
if (this.dateForm.valid) {
console.log('Form values:', this.dateForm.value);
}
}
}
<form [formGroup]="dateForm" (ngSubmit)="submitForm()">
<div>
<label for="eventDate">Event Date:</label>
<ejs-calendar
id="eventDate"
formControlName="eventDate">
</ejs-calendar>
</div>
<div>
<label for="eventName">Event Name:</label>
<input
id="eventName"
type="text"
formControlName="eventName">
</div>
<button type="submit" [disabled]="!dateForm.valid">Submit</button>
</form>
| Prop | Type | Description | Example |
|---|---|---|---|
value | Date | Single selected date | [value]="selectedDate" |
values | Date[] | Multiple selected dates | [values]="selectedDates" |
isMultiSelection | boolean | Enable multiple date selection | [isMultiSelection]="true" |
min | Date | Minimum selectable date | [min]="minDate" |
max | Date | Maximum selectable date | [max]="maxDate" |
start | CalendarView | Initial view (Month/Year/Decade) | start="Month" |
depth | CalendarView | Maximum view level | depth="Month" |
showTodayButton | boolean | Display today button | [showTodayButton]="true" |
locale | string | Culture/language code | locale="fr-FR" |
dayHeaderFormat | DayHeaderFormats | Day format (Short/Narrow/Abbreviated/Wide) | dayHeaderFormat="Abbreviated" |
weekNumber | boolean | Show week numbers | [weekNumber]="true" |
weekRule | WeekRule | Rule for first week of year (FirstDay/FirstFullWeek/FirstFourDayWeek) | weekRule="FirstFourDayWeek" |
firstDayOfWeek | number | First day (0=Sunday, 1=Monday) | [firstDayOfWeek]="1" |
cssClass | string | Custom CSS classes | cssClass="custom-calendar" |
enableRtl | boolean | Enable RTL layout | [enableRtl]="true" |
enabled | boolean | Enable/disable component | [enabled]="true" |
calendarMode | CalendarType | Calendar mode (Gregorian/Islamic) | calendarMode="Islamic" |
keyConfigs | { [key: string]: string } | Custom keyboard shortcuts | [keyConfigs]="keyConfigs" |
enablePersistence | boolean | Persist state across page reloads | [enablePersistence]="true" |
serverTimezoneOffset | number | null | Server timezone offset for initial date processing | [serverTimezoneOffset]="330" |
Use Case 1: Event Booking System
Use Case 2: Conference Schedule
Use Case 3: Accessible Booking Form
Use Case 4: International Date Picker
Use Case 5: Dynamic Date Constraints
The Syncfusion Angular DatePicker provides a user-friendly calendar interface for selecting individual dates with support for formatting, validation, date ranges, and complete accessibility (WCAG 2.2). This skill guides you through all essential implementation patterns and advanced features.
The DatePicker combines a text input with a popup calendar picker. Users can type dates directly or use the calendar to select. Key capabilities:
📄 Read: references/getting-started.md
📄 Read: references/date-formats-and-parsing.md
📄 Read: references/date-range-and-validation.md
📄 Read: references/date-views-and-navigation.md
📄 Read: references/masking-and-editing.md
📄 Read: references/styling-and-customization.md
📄 Read: references/accessibility-and-forms.md
📄 Read: references/globalization-and-localization.md
📄 Read: references/testing-guide.md
📄 Read: references/advanced-patterns.md
Basic DatePicker implementation in Angular 21+ standalone component:
import { Component } from '@angular/core';
import { DatePickerModule } from '@syncfusion/ej2-angular-calendars';
@Component({
selector: 'app-datepicker-demo',
standalone: true,
imports: [DatePickerModule],
template: `
<ejs-datepicker
placeholder="Select date"
[(ngModel)]="selectedDate"
(change)="onDateChange($event)">
</ejs-datepicker>
<p>Selected: {{ selectedDate | date:'fullDate' }}</p>
`
})
export class DatePickerDemoComponent {
selectedDate: Date | null = null;
onDateChange(event: any) {
console.log('Date changed:', event.value);
}
}
Setup Steps:
@syncfusion/ej2-angular-calendars packageDatePickerModule in component<ejs-datepicker> element with properties[(ngModel)] (two-way binding)What happens:
Restrict user to select dates between specific start and end dates:
minDate = new Date(2024, 0, 1); // Jan 1, 2024
maxDate = new Date(2024, 11, 31); // Dec 31, 2024
<ejs-datepicker
[min]="minDate"
[max]="maxDate"
placeholder="Select date in 2024">
</ejs-datepicker>
Use case: Flight booking, hotel reservations, appointment scheduling
Display dates in application-specific format:
dateFormat = 'dd/MM/yyyy'; // European format
<ejs-datepicker
[format]="dateFormat"
placeholder="DD/MM/YYYY">
</ejs-datepicker>
Guide user with visual masks and arrow key navigation:
<ejs-datepicker
[enableMask]="true"
[maskPlaceholder]="'day'"
format="dd/MM/yyyy">
</ejs-datepicker>
Keyboard navigation: Up/Down arrows increment/decrement segments, Left/Right navigate between segments
Prevent past dates in booking scenarios:
minDate = new Date(); // Today
maxDate: Date;
constructor() {
// Set max to 90 days from today
this.maxDate = new Date();
this.maxDate.setDate(this.maxDate.getDate() + 90);
}
DatePicker with reactive form validation:
import { ReactiveFormsModule, FormBuilder, Validators } from '@angular/forms';
export class FormComponent {
form = this.fb.group({
birthDate: [null, [Validators.required]],
});
constructor(private fb: FormBuilder) {}
}
<form [formGroup]="form">
<ejs-datepicker
formControlName="birthDate"
placeholder="Birth date">
</ejs-datepicker>
<span *ngIf="form.get('birthDate')?.hasError('required')">
Birth date is required
</span>
</form>
| Property | Type | Notes |
|---|---|---|
allowEdit | boolean | Whether textbox is editable (defaults true) |
calendarMode | CalendarType | Calendar type (e.g., Gregorian, Islamic) |
cssClass | string | Root CSS class for custom styling |
dayHeaderFormat | DayHeaderFormats | Day header format (Short/Narrow/Abbreviated/Wide) |
depth | CalendarView | Deepest allowed calendar view (Month/Year/Decade) |
enableMask | boolean | Enable masked date input |
enablePersistence | boolean | Persist component state between reloads |
enableRtl | boolean | Enable right-to-left rendering |
enabled | boolean | Enable or disable the component (set false to disable) |
firstDayOfWeek | number | First day of week (0-6) |
floatLabelType | FloatLabelType | string |
format | string|FormatObject | Display format for the value |
fullScreenMode | boolean | Popup full-screen mode on mobile |
htmlAttributes | { [key:string]: string } | Additional HTML attributes for root element |
inputFormats | string[]|FormatObject[] | Acceptable input formats for parsing |
keyConfigs | { [key:string]: string } | Custom key action mappings |
locale | string | Override global culture (e.g., 'en-US') |
maskPlaceholder | MaskPlaceholderModel | Placeholder text for masked input |
max | Date | Maximum selectable date |
min | Date | Minimum selectable date |
openOnFocus | boolean | Open popup on input focus |
placeholder | string | Input placeholder text |
readonly | boolean | Make input readonly (no typing) |
serverTimezoneOffset | number | Server timezone offset in minutes (optional) |
showClearButton | boolean | Show/hide clear icon |
showTodayButton | boolean | Show/hide today button in popup |
start | CalendarView | Initial view when popup opens |
strictMode | boolean | Enforce strict parsing/validation |
value | Date | Selected date value |
weekNumber | boolean | Show week numbers in calendar |
weekRule | WeekRule | Rule for first week of year |
width | number|string | Component width |
zIndex | number | Z-index for popup |
currentView() — Returns current calendar view namedestroy() — Destroy the component instancefocusIn() — Focus the inputfocusOut() — Blur the inputgetPersistData() — Returns persisted properties stringhide() — Hide the calendar popupnavigateTo(view: CalendarView, date?: Date) — Navigate to specific view/dateremoveDate(dates: Date|Date[]) — Remove date(s) from valuesshow() — Show the calendar popupblur — Emits when input loses focuschange — Emits when the value changes (provides ChangedEventArgs)cleared — Emits when clear button is usedclose — Emits when popup closes (preventable)created — Component created lifecycledestroyed — Component destroyed lifecyclefocus — Emits when input gets focusnavigated — Emits when calendar navigates to another viewopen — Emits when popup opens (preventable)renderDayCell — Emits for each day cell render (useful to disable/customize cells)A comprehensive guide for implementing the Syncfusion Essential JS 2 DateRangePicker component in Angular applications. Learn to create date range pickers, handle range selection, manage events, and customize styling.
The Syncfusion Angular DateRangePicker component is a specialized date selection widget that provides:
Package: @syncfusion/ej2-angular-calendars
Read the following references based on your specific needs:
📄 Read: references/getting-started.md
📄 Read: references/date-range-selection.md
startDate, endDate properties)📄 Read: references/preset-ranges.md
📄 Read: references/events-and-methods.md
📄 Read: references/date-formatting-and-constraints.md
📄 Read: references/keyboard-navigation-and-accessibility.md
📄 Read: references/styling-and-customization.md
📄 Read: references/globalization-and-localization.md
📄 Read: references/api-reference.md
// app.component.ts
import { Component } from '@angular/core';
import { RangeEventArgs } from '@syncfusion/ej2-calendars';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
// Date range properties
startDate: Date = new Date(2026, 2, 1); // March 1, 2026
endDate: Date = new Date(2026, 2, 31); // March 31, 2026
// Constraints
minDate: Date = new Date(2020, 0, 1);
maxDate: Date = new Date(2030, 11, 31);
// Range display
selectedRange: string = '';
// Event handler
onRangeChange(args: RangeEventArgs): void {
console.log('Start Date:', args.startDate);
console.log('End Date:', args.endDate);
console.log('Days in range:', args.daySpan);
this.updateRangeDisplay();
}
updateRangeDisplay(): void {
if (this.startDate && this.endDate) {
const start = this.startDate.toLocaleDateString();
const end = this.endDate.toLocaleDateString();
this.selectedRange = `${start} - ${end}`;
}
}
}
<!-- app.component.html -->
<div style="padding: 20px; font-family: Arial, sans-serif;">
<h2>DateRangePicker Example</h2>
<div style="margin-bottom: 20px;">
<label for="dateRange">Select Date Range:</label>
<ejs-daterangepicker
id="dateRange"
placeholder="Select a date range"
[startDate]="startDate"
[endDate]="endDate"
[min]="minDate"
[max]="maxDate"
(change)="onRangeChange($event)">
</ejs-daterangepicker>
</div>
<div *ngIf="selectedRange" style="padding: 10px; background-color: #f0f0f0;">
<p><strong>Selected Range:</strong> {{ selectedRange }}</p>
</div>
</div>
/* app.component.css */
@import '../node_modules/@syncfusion/ej2-base/styles/material3.css';
@import '../node_modules/@syncfusion/ej2-inputs/styles/material3.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material3.css';
@import '../node_modules/@syncfusion/ej2-popups/styles/material3.css';
@import '../node_modules/@syncfusion/ej2-calendars/styles/material3.css';
:host ::ng-deep .e-daterangepicker {
margin: 10px 0;
width: 100%;
}
:host ::ng-deep .e-range-header {
background-color: #3f51b5;
color: white;
}
Quick selection buttons for common date ranges:
export class AppComponent {
presets: any[] = [
{ label: 'Today', start: new Date(), end: new Date() },
{ label: 'Last 7 Days', start: this.getDateDaysAgo(7), end: new Date() },
{ label: 'Last 30 Days', start: this.getDateDaysAgo(30), end: new Date() },
{ label: 'This Month', start: this.getFirstDayOfMonth(), end: new Date() },
{ label: 'Last Month', start: this.getFirstDayOfLastMonth(), end: this.getLastDayOfLastMonth() }
];
startDate: Date = new Date();
endDate: Date = new Date();
selectPreset(preset: any): void {
this.startDate = preset.start;
this.endDate = preset.end;
}
private getDateDaysAgo(days: number): Date {
const date = new Date();
date.setDate(date.getDate() - days);
return date;
}
private getFirstDayOfMonth(): Date {
return new Date(new Date().getFullYear(), new Date().getMonth(), 1);
}
private getFirstDayOfLastMonth(): Date {
const date = new Date();
return new Date(date.getFullYear(), date.getMonth() - 1, 1);
}
private getLastDayOfLastMonth(): Date {
const date = new Date();
return new Date(date.getFullYear(), date.getMonth(), 0);
}
}
<div>
<div style="margin-bottom: 10px;">
<button *ngFor="let preset of presets"
(click)="selectPreset(preset)"
style="margin-right: 5px; padding: 8px 12px;">
{{ preset.label }}
</button>
</div>
<ejs-daterangepicker
[startDate]="startDate"
[endDate]="endDate">
</ejs-daterangepicker>
</div>
Validate date ranges with custom constraints:
export class AppComponent {
@ViewChild('daterangepicker') drp!: DateRangePickerComponent;
startDate: Date = new Date();
endDate: Date = new Date();
rangeError: string = '';
minDate: Date = new Date(2020, 0, 1);
maxDate: Date = new Date(2030, 11, 31);
minDays: number = 1; // At least 1 day
maxDays: number = 90; // At most 90 days
onRangeChange(args: RangeEventArgs): void {
this.rangeError = '';
// Validate date range
if (args.daySpan < this.minDays) {
this.rangeError = `Range must be at least ${this.minDays} day(s)`;
return;
}
if (args.daySpan > this.maxDays) {
this.rangeError = `Range cannot exceed ${this.maxDays} days`;
return;
}
this.startDate = args.startDate;
this.endDate = args.endDate;
}
isRangeValid(): boolean {
return this.rangeError === '';
}
}
Integrate DateRangePicker with Reactive Forms:
export class AppComponent implements OnInit {
reportForm: FormGroup;
constructor(private fb: FormBuilder) {
this.reportForm = this.fb.group({
reportName: ['', Validators.required],
startDate: [new Date(2026, 0, 1), Validators.required],
endDate: [new Date(), Validators.required]
});
}
ngOnInit(): void {
this.reportForm.get('startDate')?.valueChanges.subscribe(date => {
console.log('Start date changed:', date);
this.validateDateRange();
});
this.reportForm.get('endDate')?.valueChanges.subscribe(date => {
console.log('End date changed:', date);
this.validateDateRange();
});
}
validateDateRange(): void {
const start = this.reportForm.get('startDate')?.value;
const end = this.reportForm.get('endDate')?.value;
if (start && end && start > end) {
this.reportForm.get('endDate')?.setErrors({ 'invalidRange': true });
} else {
this.reportForm.get('endDate')?.setErrors(null);
}
}
submitForm(): void {
if (this.reportForm.valid) {
console.log('Form values:', this.reportForm.value);
}
}
}
<form [formGroup]="reportForm" (ngSubmit)="submitForm()">
<div>
<label>Report Name:</label>
<ejs-textbox
formControlName="reportName"
placeholder="Enter report name">
</ejs-textbox>
</div>
<div>
<label>Report Period:</label>
<ejs-daterangepicker
[formControl]="reportForm.get('startDate')"
[endDate]="reportForm.get('endDate')?.value">
</ejs-daterangepicker>
</div>
<button type="submit" [disabled]="!reportForm.valid">Generate Report</button>
</form>
Update range constraints based on business logic:
export class AppComponent {
startDate: Date = new Date();
endDate: Date = new Date();
// Dynamic constraints
minDate: Date = new Date();
maxDate: Date = new Date();
reportType: string = 'daily';
onReportTypeChange(type: string): void {
this.reportType = type;
this.updateConstraints();
}
private updateConstraints(): void {
const today = new Date();
switch (this.reportType) {
case 'daily':
// Last 7 days only
this.minDate = new Date(today.getTime() - 7 * 24 * 60 * 60 * 1000);
this.maxDate = today;
break;
case 'monthly':
// Last 12 months
this.minDate = new Date(today.getFullYear() - 1, today.getMonth(), 1);
this.maxDate = today;
break;
case 'yearly':
// Last 5 years
this.minDate = new Date(today.getFullYear() - 5, 0, 1);
this.maxDate = today;
break;
}
}
}
Disable specific date ranges (holidays, blackout dates):
export class AppComponent {
disabledRanges: Array<{start: Date, end: Date}> = [
{ start: new Date(2026, 11, 20), end: new Date(2026, 11, 31) }, // Christmas season
{ start: new Date(2026, 0, 1), end: new Date(2026, 0, 3) } // New Year
];
startDate: Date = new Date();
endDate: Date = new Date();
onRenderDayCell(args: RenderDayCellEventArgs): void {
// Disable dates in disabled ranges
for (const range of this.disabledRanges) {
if (args.date >= range.start && args.date <= range.end) {
args.isDisabled = true;
break;
}
}
}
}
| Prop | Type | Description | Example |
|---|---|---|---|
startDate | Date | Start date of the range | [startDate]="start" |
endDate | Date | End date of the range | [endDate]="end" |
value | Date[] or DateRange | Selected date range (array or object) | [(ngModel)]="dateRange" |
min | Date | Minimum selectable date | [min]="minDate" |
max | Date | Maximum selectable date | [max]="maxDate" |
minDays | number | Minimum days in range | [minDays]="1" |
maxDays | number | Maximum days in range | [maxDays]="90" |
format | string | Date display format | format="dd/MM/yyyy" |
separator | string | Range separator character | separator=" to " |
placeholder | string | Placeholder text | placeholder="Select date range" |
presets | PresetsModel[] | Predefined range options | [presets]="presets" |
strictMode | boolean | Strict date validation | [strictMode]="true" |
readonly | boolean | Read-only input field | [readonly]="false" |
enabled | boolean | Enable/disable component | [enabled]="true" |
locale | string | Culture/language code | locale="en-US" |
enableRtl | boolean | Enable RTL layout | [enableRtl]="false" |
cssClass | string | Custom CSS classes | cssClass="custom-drp" |
width | number | string | Component width | width="300px" |
allowEdit | boolean | Allow manual text input | [allowEdit]="true" |
openOnFocus | boolean | Open picker on input focus | [openOnFocus]="true" |
showClearButton | boolean | Show clear button | [showClearButton]="true" |
depth | CalendarView | Calendar view depth | depth="Month" |
Use Case 1: Report Date Range Selection
Use Case 2: Booking System Range
Use Case 3: Analytics Date Filter
Use Case 4: Accessible Form Field
Use Case 5: International Date Picker
A comprehensive guide for implementing the Syncfusion Essential JS 2 DatetimePicker component in Angular applications. Learn to create date and time selection interfaces, manage calendars and time pickers, handle events, and customize styling.
The Syncfusion Angular DatetimePicker component is a combined date and time selection widget that provides:
Package: @syncfusion/ej2-angular-datetimepickers
Read the following references based on your specific needs:
📄 Read: references/getting-started.md
📄 Read: references/basic-implementation.md
📄 Read: references/date-time-configuration.md
📄 Read: references/calendar-and-time-views.md
📄 Read: references/events-and-callbacks.md
📄 Read: references/methods-and-imperative-access.md
📄 Read: references/advanced-features.md
📄 Read: references/styling-and-customization.md
📄 Read: references/accessibility-and-globalization.md
📄 Read: references/api-reference.md
// app.component.ts
import { Component } from '@angular/core';
import { ChangedEventArgs } from '@syncfusion/ej2-datetimepickers';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
// Simple datetime value
dateTimeValue: Date = new Date();
// Configuration
minDate: Date = new Date(2020, 0, 1);
maxDate: Date = new Date(2030, 11, 31);
dateFormat: string = 'dd/MM/yyyy hh:mm a';
timeFormat: string = 'hh:mm a';
// Event handler
onDateTimeChange(args: ChangedEventArgs): void {
console.log('Selected DateTime:', args.value);
console.log('Event Type:', args.type);
}
onPopupOpen(): void {
console.log('Popup opened');
}
onPopupClose(): void {
console.log('Popup closed');
}
}
<!-- app.component.html -->
<div style="padding: 20px;">
<h2>Select Date & Time</h2>
<ejs-datetimepicker
id="datetimepicker"
[value]="dateTimeValue"
[format]="dateFormat"
[timeFormat]="timeFormat"
[min]="minDate"
[max]="maxDate"
placeholder="Select date and time"
(change)="onDateTimeChange($event)"
(open)="onPopupOpen()"
(close)="onPopupClose()">
</ejs-datetimepicker>
<p *ngIf="dateTimeValue">
Selected: {{ dateTimeValue | date:'medium' }}
</p>
</div>
Select a start and end datetime for appointments, bookings, or events:
export class AppComponent {
startDateTime: Date = new Date();
endDateTime: Date = new Date(Date.now() + 3600000); // +1 hour
onStartChange(args: ChangedEventArgs): void {
// Ensure end is after start
if (this.endDateTime <= args.value) {
this.endDateTime = new Date((args.value as Date).getTime() + 3600000);
}
}
}
Restrict time selection to business hours (9 AM - 5 PM):
export class AppComponent {
minTime: Date = new Date(2026, 2, 24, 9, 0); // 9:00 AM
maxTime: Date = new Date(2026, 2, 24, 17, 0); // 5:00 PM
datetimeValue: Date = new Date(2026, 2, 24, 10, 0);
}
<ejs-datetimepicker
[value]="datetimeValue"
[minTime]="minTime"
[maxTime]="maxTime"
timeFormat="hh:mm a">
</ejs-datetimepicker>
Use masked input to guide users through the datetime format:
export class AppComponent {
datetimeValue: Date;
maskPlaceholder = {
day: 'dd',
month: 'mm',
year: 'yyyy',
hour: 'hh',
minute: 'mm',
second: 'ss'
};
}
<ejs-datetimepicker
[value]="datetimeValue"
[enableMask]="true"
[maskPlaceholder]="maskPlaceholder"
format="dd/MM/yyyy hh:mm:ss">
</ejs-datetimepicker>
Integrate datetimepicker with Angular Reactive Forms:
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
export class AppComponent {
appointmentForm: FormGroup;
constructor(private fb: FormBuilder) {
this.appointmentForm = this.fb.group({
appointmentDateTime: [
new Date(),
[Validators.required]
]
});
}
submitForm(): void {
if (this.appointmentForm.valid) {
console.log(this.appointmentForm.value);
}
}
}
<form [formGroup]="appointmentForm">
<ejs-datetimepicker
formControlName="appointmentDateTime"
format="dd/MM/yyyy hh:mm a">
</ejs-datetimepicker>
<button (click)="submitForm()" [disabled]="!appointmentForm.valid">
Submit
</button>
</form>
Disable weekends and specific dates:
export class AppComponent {
datetimeValue: Date;
onRenderDayCell(args: RenderDayCellEventArgs): void {
// Disable weekends (0 = Sunday, 6 = Saturday)
if ((args.date as Date).getDay() === 0 || (args.date as Date).getDay() === 6) {
args.isDisabled = true;
}
// Disable specific dates
const disabledDates = [5, 15, 25]; // 5th, 15th, 25th of each month
if (disabledDates.includes((args.date as Date).getDate())) {
args.isDisabled = true;
}
}
}
<ejs-datetimepicker
[value]="datetimeValue"
(renderDayCell)="onRenderDayCell($event)">
</ejs-datetimepicker>
| Property | Type | Purpose |
|---|---|---|
value | Date | Selected datetime value for two-way binding |
format | string | Date display format (e.g., 'dd/MM/yyyy hh:mm a') |
timeFormat | string | Time display format in popup (e.g., 'hh:mm a') |
min | Date | Minimum selectable date |
max | Date | Maximum selectable date |
minTime | Date | Minimum selectable time |
maxTime | Date | Maximum selectable time |
step | number | Time interval in minutes (15, 30, 60) |
enabled | boolean | Enable/disable the component |
readonly | boolean | Make input readonly (select from popup only) |
placeholder | string | Placeholder text in input |
enableMask | boolean | Enable masked input mode |
strictMode | boolean | Enforce valid values only |
enableRtl | boolean | Right-to-left language support |
enablePersistence | boolean | Persist value across page reloads |
start | CalendarView | Initial calendar view (Month/Year/Decade) |
depth | CalendarView | Maximum calendar view level |
locale | string | Locale for formatting (e.g., 'en-US', 'de-DE') |
A comprehensive guide for implementing the Syncfusion Essential JS 2 TimePicker component in Angular applications. Learn to create time selection interfaces, manage time inputs, handle events, and customize styling.
The Syncfusion Angular TimePicker component is a dedicated time selection widget that provides:
Package: @syncfusion/ej2-angular-calendars
Read the following references based on your specific needs:
📄 Read: references/getting-started.md
📄 Read: references/basic-implementation.md
📄 Read: references/time-configuration.md
📄 Read: references/events-and-callbacks.md
📄 Read: references/methods-and-imperative-access.md
📄 Read: references/advanced-features.md
📄 Read: references/styling-and-customization.md
📄 Read: references/accessibility-and-globalization.md
📄 Read: references/api-reference.md
// app.component.ts
import { Component } from '@angular/core';
import { ChangeEventArgs } from '@syncfusion/ej2-calendars';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
// Simple time value
timeValue: Date = new Date();
// Configuration
minTime: Date = new Date(2026, 2, 24, 8, 0); // 8:00 AM
maxTime: Date = new Date(2026, 2, 24, 20, 0); // 8:00 PM
format: string = 'hh:mm a';
step: number = 30; // 30-minute intervals
// Event handler
onTimeChange(args: ChangeEventArgs): void {
console.log('Selected Time:', args.value);
console.log('Selected Text:', args.text);
console.log('Is User Interaction:', args.isInteracted);
}
onPopupOpen(): void {
console.log('Time popup opened');
}
onPopupClose(): void {
console.log('Time popup closed');
}
}
<!-- app.component.html -->
<div style="padding: 20px;">
<h2>Select a Time</h2>
<ejs-timepicker
id="timepicker"
[value]="timeValue"
[format]="format"
[min]="minTime"
[max]="maxTime"
[step]="step"
placeholder="Select time"
(change)="onTimeChange($event)"
(open)="onPopupOpen()"
(close)="onPopupClose()">
</ejs-timepicker>
<p *ngIf="timeValue">
Selected Time: {{ timeValue | date:'shortTime' }}
</p>
</div>
Select time within business hours (9 AM - 6 PM):
export class AppComponent {
minTime: Date = new Date(2026, 2, 24, 9, 0); // 9:00 AM
maxTime: Date = new Date(2026, 2, 24, 18, 0); // 6:00 PM
timeValue: Date = new Date(2026, 2, 24, 10, 0);
format: string = 'hh:mm a';
step: number = 15; // 15-minute intervals
}
<ejs-timepicker
[value]="timeValue"
[min]="minTime"
[max]="maxTime"
[step]="step"
[format]="format"
placeholder="Select appointment time">
</ejs-timepicker>
Display time in 24-hour military format:
export class AppComponent {
timeValue: Date = new Date();
format: string = 'HH:mm'; // 24-hour format
step: number = 30;
}
<ejs-timepicker
[value]="timeValue"
[format]="format"
[step]="step"
placeholder="Select time (24-hour)">
</ejs-timepicker>
Use masked input to guide users through time entry:
export class AppComponent {
timeValue: Date;
enableMask: boolean = true;
maskPlaceholder = {
hour: 'hh',
minute: 'mm',
second: 'ss'
};
format: string = 'hh:mm:ss a';
}
<ejs-timepicker
[value]="timeValue"
[enableMask]="enableMask"
[maskPlaceholder]="maskPlaceholder"
format="hh:mm:ss a">
</ejs-timepicker>
Integrate timepicker with Angular Reactive Forms:
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
export class AppComponent {
appointmentForm: FormGroup;
constructor(private fb: FormBuilder) {
this.appointmentForm = this.fb.group({
appointmentTime: [
new Date(),
[Validators.required]
]
});
}
submitForm(): void {
if (this.appointmentForm.valid) {
console.log(this.appointmentForm.value);
}
}
}
<form [formGroup]="appointmentForm">
<ejs-timepicker
formControlName="appointmentTime"
format="hh:mm a"
placeholder="Select time">
</ejs-timepicker>
<button (click)="submitForm()" [disabled]="!appointmentForm.valid">
Submit
</button>
</form>
Select start and end times for a duration:
export class AppComponent {
startTime: Date = new Date();
endTime: Date = new Date(Date.now() + 3600000); // +1 hour
onStartTimeChange(args: ChangeEventArgs): void {
// Ensure end time is after start time
if (args.value && this.endTime <= args.value) {
this.endTime = new Date(args.value.getTime() + 3600000); // +1 hour
}
}
}
<div>
<label>Start Time:</label>
<ejs-timepicker
[value]="startTime"
format="hh:mm a"
(change)="onStartTimeChange($event)">
</ejs-timepicker>
<label>End Time:</label>
<ejs-timepicker
[value]="endTime"
[min]="startTime"
format="hh:mm a">
</ejs-timepicker>
</div>
| Property | Type | Purpose |
|---|---|---|
value | Date | Selected time value for two-way binding |
format | string | Time display format (e.g., 'hh:mm a') |
min | Date | Minimum selectable time |
max | Date | Maximum selectable time |
step | number | Time interval in minutes (15, 30, 60) |
enabled | boolean | Enable/disable the component |
readonly | boolean | Make input readonly (select from popup only) |
placeholder | string | Placeholder text in input |
enableMask | boolean | Enable masked input mode |
strictMode | boolean | Enforce valid values only |
enableRtl | boolean | Right-to-left language support |
enablePersistence | boolean | Persist value across page reloads |
scrollTo | Date | Default scroll position in time list |
locale | string | Locale for formatting (e.g., 'en-US', 'de-DE') |
cssClass | string | Custom CSS class for styling |
width | string | Component width |
zIndex | number | Z-index for popup |
showClearButton | boolean | Show/hide clear icon |
openOnFocus | boolean | Open popup on input focus |
floatLabelType | string | Floating label behavior (Never/Always/Auto) |
references/calendar-accessibility-and-globalization.md (opens in a new tab)references/calendar-api-reference.md (opens in a new tab)references/calendar-date-selection.md (opens in a new tab)references/calendar-events-and-methods.md (opens in a new tab)references/calendar-getting-started.md (opens in a new tab)references/calendar-navigation.md (opens in a new tab)references/calendar-styling-and-customization.md (opens in a new tab)references/calendar-views.md (opens in a new tab)references/datepicker-accessibility-and-forms.md (opens in a new tab)references/datepicker-advanced-patterns.md (opens in a new tab)references/datepicker-date-formats-and-parsing.md (opens in a new tab)references/datepicker-date-range-and-validation.md (opens in a new tab)references/datepicker-date-views-and-navigation.md (opens in a new tab)references/datepicker-getting-started.md (opens in a new tab)references/datepicker-globalization-and-localization.md (opens in a new tab)references/datepicker-masking-and-editing.md (opens in a new tab)references/datepicker-styling-and-customization.md (opens in a new tab)references/datepicker-testing-guide.md (opens in a new tab)references/daterangepicker-api-reference.md (opens in a new tab)references/daterangepicker-date-formatting-and-constraints.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-angular65 skills in this plugin
/syncfusion-angular-3d-chartImplement interactive 3D charts in Angular applications using Syncfusion. Guide covers setup, chart types (bar, column, stacked variants), customization, data binding, axis configuration, legends, tooltips, selection, data labels, appearance styling, dimensions, print/export, and accessibility. Use this skill whenever a user needs to create, configure, or customize 3D chart visualizations./syncfusion-angular-accordionGuide for implementing Angular Accordion components for collapsible content panels, expandable sections, FAQs, multi-step wizards, step-by-step forms, navigation menus, or tabbed navigation. Use this skill when users mention expanding/collapsing content, accordion layouts, step-by-step workflows, or hierarchical content organization. This skill covers initialization, expand modes, data binding, dynamic loading, animations, nested accordions, and real-world patterns./syncfusion-angular-accumulation-chartImplement and customize Syncfusion Angular Accumulation Charts (Pie, Doughnut, Pyramid, Funnel) with data binding, labels, legends, and tooltips. Use this when creating accumulation charts, configuring chart types, customizing data visualization, adding annotations, or handling interactive chart events in Angular applications.Other plugins' skills for the same job