Skip to content

Conversation

@qaz74107410
Copy link

Description

When timePickerIncrement is set with singleDatePicker enabled, the component was applying both 'start-date' and 'end-date' classes to the same date cell (since both startDate and endDate are set to the same value in single date picker mode). This caused the date to display with an incorrect visual style.

The Problem

In single date picker mode with time picker increment:

  • The active class was appearing on both dates instead of just the selected single date
  • This was because both 'start-date' and 'end-date' classes were being applied when the dates matched

The Solution

The fix prevents adding the 'end-date' class when in singleDatePicker mode and the end date matches the start date, ensuring only the 'start-date' class is applied.

Changes Made

Modified the buildCells method in src/daterangepicker/daterangepicker.component.ts:

  • Added a condition to prevent adding the 'end-date' class when in singleDatePicker mode and both dates are the same
  • This ensures the date displays with only the 'start-date' class styling

Related Issue

Fixes #351

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.

timePickerIncrement set cause singleDatePicker active class not on single date

1 participant