Skip to content

fix(DatePicker): disable the Today button when today's date is disabled#599

Merged
mrholek merged 1 commit into
mainfrom
fix/date-picker-today-button-disabled
Jul 13, 2026
Merged

fix(DatePicker): disable the Today button when today's date is disabled#599
mrholek merged 1 commit into
mainfrom
fix/date-picker-today-button-disabled

Conversation

@mrholek

@mrholek mrholek commented Jul 13, 2026

Copy link
Copy Markdown
Member

Problem

In the Date Picker, clicking the Today button selected today's date even when today was a disabled date (excluded by minDate/maxDate or disabledDates). The disabled-date guard only ran on the text-input path, not on the Today button, so users could pick a disabled date.

Fix

Disable the Today button when isDateDisabled(new Date(), minDate, maxDate, disabledDates) is true — the same check already used on the input path. Applies to both DatePicker and DateRangePicker (they share the footer).

Tests

Added specs asserting the Today button is disabled when today is out of range and enabled otherwise.

Cross-framework parity: same fix ported to coreui-react-pro and coreui-vue-pro. Angular has no built-in Today button (consumer-supplied footer template), so it is not affected.

it('should not disable today button when today is selectable', () => {
fixtureEl.innerHTML = '<div></div>'
const div = fixtureEl.querySelector('div')
const dateRangePicker = new DateRangePicker(div, { // eslint-disable-line no-unused-vars
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 29268009803

Coverage increased (+0.06%) to 94.704%

Details

  • Coverage increased (+0.06%) from the base build.
  • Patch coverage: 2 of 2 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 7455
Covered Lines: 7183
Line Coverage: 96.35%
Relevant Branches: 3081
Covered Branches: 2795
Branch Coverage: 90.72%
Branches in Coverage %: Yes
Coverage Strength: 778.09 hits per line

💛 - Coveralls

@mrholek mrholek merged commit 995e0c2 into main Jul 13, 2026
6 of 7 checks passed
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.

3 participants