Skip to content

♻️ Align Time Picker header styling with Date Picker header#77

Open
balajis-qb wants to merge 1 commit intomainfrom
fix/style/time-picker-header
Open

♻️ Align Time Picker header styling with Date Picker header#77
balajis-qb wants to merge 1 commit intomainfrom
fix/style/time-picker-header

Conversation

@balajis-qb
Copy link
Collaborator

Description

Problem
As highlighted in the below image, there is a small mismatch between the DatePicker's header and TimePicker's header.

image

Code

const Default = () => {
  const [selectedDate, setSelectedDate] = useState<Date | null>(new Date());

  const handleChange = (date: Date | null) => {
    setSelectedDate(date);
  };

  return (
    <DatePicker
      selected={selectedDate}
      onChange={handleChange}
      showTimeSelect
    />
  );
};

Changes

  • Update the Time Select header to be same as the DatePicker's Header
  • Refactored the time header from a div to an h2 element for better semantic structure.
  • Added a test to ensure the default time caption is rendered correctly.

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

…les to match with DatePicker's header

- Updated the time header in the DatePicker component from a div to an h2 element for better semantic structure.
- Adjusted the SCSS styles to include the new h2 class for consistent styling.
- Added a test to ensure the default time caption is rendered correctly.
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.

1 participant