Skip to main content

Week Numbers

Display ISO week numbers alongside calendar dates for business and planning applications.

Enabling Week Numbers

Week Number Types

The component supports different week numbering systems:
The first-4-day-week type follows ISO 8601, where week 1 is the first week with at least 4 days in the new year.
From src/mixins/date-picker-mixin.ts:39:

Customizing Week Number Labels

From src/constants.ts:12-15:
Example with custom labels:

Disabled Dates

Prevent selection of specific dates (holidays, blackout dates, unavailable dates).

Single and Multiple Dates

From src/date-picker/date-picker.ts:126-127:
The splitString helper splits the comma-separated string and converts each value using toResolvedDate.

Using with Template Literals

Dynamic Disabled Dates

Disabled Days of Week

Disable specific days of the week (e.g., weekends, specific business days).

Basic Usage

Day numbers follow JavaScript’s Date.getDay() convention: 0 = Sunday, 1 = Monday, …, 6 = Saturday.

Common Patterns

From src/date-picker/date-picker.ts:127-128:
The splitString helper converts comma-separated day numbers to an array of numbers.

Date Range Constraints

Limit selectable dates to a specific range using min and max properties.

Basic Range

Dynamic Ranges

Default Range Values

From src/constants.ts:16 and src/date-picker/date-picker.ts:256-257:
If min or max is set to a falsy value, it will be overridden with the default. The default min is today’s date, and the default max is December 31, 2100.

Combining Constraints

Start View Configuration

Control which view the calendar opens to:
From src/constants.ts:22:

Use Cases

View Switching

Users can switch between views by clicking the year/month dropdown button:
From src/date-picker/date-picker.ts:223-225:

Value Clamping

When setting a value outside the min/max range, it’s automatically clamped:
From src/date-picker/date-picker.ts:419-421:
Navigation buttons are automatically hidden when at min/max boundaries:
From src/date-picker/date-picker.ts:314-315:

Complete Advanced Example

Here’s a complete example combining multiple advanced features:

Keyboard Navigation

The component supports full keyboard navigation:
From src/constants.ts:17-21:
Keyboard navigation automatically skips disabled dates and respects min/max boundaries.

Accessibility Features

  • Full keyboard navigation support
  • ARIA labels for all interactive elements
  • Screen reader announcements for date changes
  • Focus management for optimal navigation
  • High contrast mode support
When using disabled dates extensively, ensure there are selectable dates available. A calendar with all dates disabled provides a poor user experience.

Performance Considerations

For large numbers of disabled dates (50+), consider server-side date validation instead of passing hundreds of dates via the disabledDates property.
Use disabledDays instead of disabledDates when pattern-based disabling (e.g., all weekends) is sufficient - it’s more performant.

Next Steps

API Reference

Complete property and method documentation

Basic Usage

See more usage patterns and examples