angular / angular/components

feat(timepicker): Add disabled options support for MatTimepickerOption

Open
#31,842 0 comments 0 reactions 0 assignees View on GitHub
area: material/timepicker feature P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Feature Description

Add support for disabling specific time options in `MatTimepicker` to prevent users from selecting certain hours, minutes, or time ranges when using `customOptions`

### Proposed API
```typescript
interface MatTimepickerOption {
/** Date value of the option. */
value: D;
/** Label to show to the user. */
label: string;
/** Option is enable or disable. */
disabled?: boolean
}
```

### Use Case

### **Event Booking (Bar / restaurant)**
Make clear that some time ranges are not available for booking (ie: Opening hours), instead of not showing them

Contributor guide

Open the contributing guide

Research direction

Locate the MatTimepicker and MatTimepickerOption definitions, then trace how customOptions are handled for hours, minutes, and time ranges. Add coverage showing disabled options cannot be selected while remaining visible, and verify the existing timepicker tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.