Skip to content

Fix incorrect "today" date highlight in Calendar component #742

@Krishna-sm

Description

@Krishna-sm

📄 Description

The Calendar component is incorrectly highlighting the "today" date.

From the attached screenshot, the selected/highlighted date is 5, but it is not actually today's date. The UI suggests that this is the current day (with a filled background and dot indicator), which is misleading.

This creates confusion for users, as the "today" state should always reflect the system date, not a previously selected or default value.

📸 Screenshot

Image

The date 5 is highlighted as "today", which appears incorrect.


⚠️ Expected Behavior

  • The calendar should automatically detect and highlight the current system date.

  • "Today" should:

    • Be visually distinct (as per design system)
    • Update correctly on render
  • If a user selects another date, it should not override the "today" indicator styling.


❌ Actual Behavior

  • A non-current date (e.g., 5) is shown as "today"

  • The highlight appears to be:

    • Either a default state
    • Or incorrectly tied to selected instead of today

✅ To Do

  • Verify how "today" is calculated (e.g., new Date() vs controlled state)

  • Ensure "today" and "selected" states are handled separately

  • Fix styling logic:

    • today → indicator (dot / subtle highlight)
    • selected → active selection (background)
  • Add test cases:

    • Renders correct "today" date
    • Selecting another date does not override "today"
  • Check timezone edge cases (UTC vs local time)

  • Validate behavior across different months navigation


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions