Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计通过

syncfusion-angular-daterangepickersyncfusion Angular daterangepicker 命令行

Agent Skill

syncfusion-angular-daterangepicker 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

635

周安装

27

GitHub Stars

公开资料未说明

下载量

222
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:syncfusion-angular-daterangepicker(syncfusion Angular daterangepicker 命令行)
来源仓库:https://github.com/syncfusion/angular-ui-components-skills
仓库路径:skills/syncfusion-angular-daterangepicker
安装命令:
npx skills add https://github.com/syncfusion/angular-ui-components-skills --skill syncfusion-angular-daterangepicker
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/syncfusion/angular-ui-components-skills --skill syncfusion-angular-daterangepicker

简介

实现日期区间选择功能,支持起止时间联动与常用范围预设。

  • 适用于财务周期、活动报名等需要双端点选择的业务场景。
  • 通过 GitHub 仓库安装,使用 npx 命令添加技能并指定路径。
  • 需校验用户输入合法性,防止未来日期或非法跨度提交。syncfusion-angular-daterangepicker 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 与后端接口对接时应统一时间格式,避免时区解析错误。

SKILL.md

Implementing Syncfusion Angular DateRangePicker

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.

DateRangePicker Overview

The Syncfusion Angular DateRangePicker component is a specialized date selection widget that provides:

  • Dual calendar display: Start and end date selection with synchronized calendars
  • Preset ranges: Predefined options like "Last 7 Days", "This Month", "Last Month", "Custom"
  • Range validation: Min/max dates, disabled ranges, required range length
  • Date formatting: Customizable date format with separators and pattern support
  • Event system: Created, destroyed, change, select, rangeSelected, open, close, renderDayCell events
  • Keyboard shortcuts: Tab, arrow keys, enter, escape for full keyboard accessibility
  • Localization support: Locale-specific formatting, day headers, month names
  • Accessibility: Full WCAG 2.2 compliance, ARIA attributes, screen reader support
  • Rich customization: CSS classes, custom templates, day cell rendering
  • Mobile optimization: Touch-friendly interface, responsive design, full-screen mode

Package: @syncfusion/ej2-angular-calendars

Documentation Navigation

Read the following references based on your specific needs:

Getting Started

📄 Read: references/getting-started.md

  • Package installation and module setup
  • CSS theme imports and dependencies
  • Basic DateRangePicker implementation
  • Component initialization in Angular
  • Start and end date configuration
  • Running and testing setup

Date Range Selection

📄 Read: references/date-range-selection.md

  • Single click range selection
  • Sequential date selection (click start, then end)
  • Date range value binding (startDate, endDate properties)
  • Min/max date constraints
  • Range validation and error handling
  • Disabled date ranges
  • Clearing selections

Preset Ranges

📄 Read: references/preset-ranges.md

  • Predefined range options (Last 7 Days, Last Month, etc.)
  • Custom preset configuration
  • Programmatic preset application
  • Dynamic preset generation
  • Preset change events
  • Combining presets with constraints

Events & Methods

📄 Read: references/events-and-methods.md

  • Event handlers (change, select, rangeSelected, open, close)
  • Range selection event details (startDate, endDate, daySpan)
  • Programmatic methods (show(), hide(), getSelectedRange())
  • Created and destroyed lifecycle events
  • RenderDayCell for custom styling
  • Method return types and parameters

Date Formatting & Constraints

📄 Read: references/date-formatting-and-constraints.md

  • Date format patterns and separators
  • Multiple format support (format and inputFormats)
  • Min/max date constraints
  • Min/max days validation
  • Disabled dates configuration
  • Format error handling
  • Locale-specific formats

Keyboard Navigation & Accessibility

📄 Read: references/keyboard-navigation-and-accessibility.md

  • Tab and Shift+Tab navigation
  • Arrow keys for date navigation
  • Enter for range selection and confirmation
  • Escape to close picker
  • Alt key shortcuts
  • Screen reader compatibility
  • ARIA labels and roles
  • WCAG 2.2 AA compliance
  • Focus management

Styling & Customization

📄 Read: references/styling-and-customization.md

  • CSS class customization (.e-daterangepicker,.e-calendar,.e-range-header)
  • Theme selection (Material, Bootstrap, Tailwind, Fabric)
  • Dark mode implementation
  • Custom day cell styling via renderDayCell
  • Disabled date styling
  • Preset button styling
  • Hover and focus states
  • Responsive layout customization

Globalization & Localization

📄 Read: references/globalization-and-localization.md

  • Locale property for date formatting
  • RTL (Right-to-Left) support for Arabic, Hebrew
  • Day header formats (Short, Narrow, Abbreviated, Wide)
  • Month names and day names localization
  • Custom locale support
  • Timezone handling
  • Date format localization

API Reference

📄 Read: references/api-reference.md

  • Complete property reference with descriptions
  • All method signatures with return types
  • Event argument types and structures
  • Type interfaces (RangeEventArgs, NavigatingEventArgs, etc.)
  • CSS classes and styling hooks
  • Browser support matrix

Quick Start Example

// 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;
}

Common Patterns

Pattern 1: Preset Date Ranges

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>

Pattern 2: Date Range Validation

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 === '';
  }
}

Pattern 3: Reactive Form Integration

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>

Pattern 4: Dynamic Range Constraints

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;
    }
  }
}

Pattern 5: Disabled Date Ranges

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;
      }
    }
  }
}

Key Props Reference

PropTypeDescriptionExample
startDateDateStart date of the range[startDate]="start"
endDateDateEnd date of the range[endDate]="end"
valueDate[] or DateRangeSelected date range (array or object)[(ngModel)]="dateRange"
minDateMinimum selectable date[min]="minDate"
maxDateMaximum selectable date[max]="maxDate"
minDaysnumberMinimum days in range[minDays]="1"
maxDaysnumberMaximum days in range[maxDays]="90"
formatstringDate display formatformat="dd/MM/yyyy"
separatorstringRange separator characterseparator=" to "
placeholderstringPlaceholder textplaceholder="Select date range"
presetsPresetsModel[]Predefined range options[presets]="presets"
strictModebooleanStrict date validation[strictMode]="true"
readonlybooleanRead-only input field[readonly]="false"
enabledbooleanEnable/disable component[enabled]="true"
localestringCulture/language codelocale="en-US"
enableRtlbooleanEnable RTL layout[enableRtl]="false"
cssClassstringCustom CSS classescssClass="custom-drp"
width`number \string`Component widthwidth="300px"
allowEditbooleanAllow manual text input[allowEdit]="true"
openOnFocusbooleanOpen picker on input focus[openOnFocus]="true"
showClearButtonbooleanShow clear button[showClearButton]="true"
depthCalendarViewCalendar view depthdepth="Month"

Common Use Cases

Use Case 1: Report Date Range Selection

  • User selects date range for report generation
  • Apply min/max date constraints
  • Support preset ranges (Last 7 Days, Last Month, etc.)
  • Solution: Combine startDate/endDate with presets and min/max constraints
  • Reference: Preset Ranges + Date Formatting & Constraints

Use Case 2: Booking System Range

  • Select check-in and check-out dates for booking
  • Disable past dates and blackout dates
  • Show day count in range
  • Solution: Use min date constraint, renderDayCell for disabled ranges, calculate daySpan
  • Reference: Date Range Selection + Events & Methods

Use Case 3: Analytics Date Filter

  • Select date range for analytics dashboard
  • Multiple preset options for quick selection
  • Responsive mobile-friendly interface
  • Solution: Use presets with responsive styling and touch optimization
  • Reference: Preset Ranges + Styling & Customization

Use Case 4: Accessible Form Field

  • DateRangePicker integrated in form with full keyboard accessibility
  • Screen reader compatible, WCAG 2.2 compliant
  • Solution: Use with Reactive Forms, proper ARIA labels
  • Reference: Keyboard Navigation & Accessibility

Use Case 5: International Date Picker

  • Support multiple languages and date formats
  • Show RTL for Arabic, Hebrew
  • Locale-specific formatting
  • Solution: Use locale property and format customization
  • Reference: Globalization & Localization

Related Skills


Next Steps: Choose a reference guide above based on your specific needs, or explore the common patterns section for your use case.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.37%
按下载量换算81

Claude

30.54%
按下载量换算68

Cursor

19.65%
按下载量换算44

Gemini CLI

11.29%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills