Skip to content

Breaking: Fix typo of the name of the function getHightLightDaysMap w… #4808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/date_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ export interface HighlightDate {
* @param defaultClassName The default class to use for highlighting.
* @returns A map with dates as keys and arrays of class names as values.
*/
export function getHightLightDaysMap(
export function getHighLightDaysMap(
highlightDates: (Date | HighlightDate)[] = [],
defaultClassName: string = "react-datepicker__day--highlighted",
): Map<string, string[]> {
Expand Down
6 changes: 3 additions & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
parseDate,
safeDateFormat,
safeDateRangeFormat,
getHightLightDaysMap,
getHighLightDaysMap,
getYear,
getMonth,
getStartOfWeek,
Expand Down Expand Up @@ -339,7 +339,7 @@ export default class DatePicker extends Component<
}
if (prevProps.highlightDates !== this.props.highlightDates) {
this.setState({
highlightDates: getHightLightDaysMap(this.props.highlightDates),
highlightDates: getHighLightDaysMap(this.props.highlightDates),
});
}
if (
Expand Down Expand Up @@ -414,7 +414,7 @@ export default class DatePicker extends Component<
: this.props.selected) ?? boundedPreSelection,
// transforming highlighted days (perhaps nested array)
// to flat Map for faster access in day.jsx
highlightDates: getHightLightDaysMap(this.props.highlightDates),
highlightDates: getHighLightDaysMap(this.props.highlightDates),
focused: false,
// used to focus day in inline version after month has changed, but not on
// initial render
Expand Down
12 changes: 6 additions & 6 deletions test/day_test.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
addDays,
subDays,
getMonth,
getHightLightDaysMap,
getHighLightDaysMap,
getHolidaysMap,
registerLocale,
} from "../src/date_utils";
Expand Down Expand Up @@ -221,7 +221,7 @@ describe("Day", () => {
const highlightDay1 = newDate(day);
const highlightDay2 = addDays(day, 1);
const highlightDates = [highlightDay1, highlightDay2];
const highlightDatesMap = getHightLightDaysMap(highlightDates);
const highlightDatesMap = getHighLightDaysMap(highlightDates);
const container = renderDay(day, { highlightDates: highlightDatesMap });
expect(
container
Expand All @@ -235,7 +235,7 @@ describe("Day", () => {
const highlightDay1 = subDays(day, 1);
const highlightDay2 = addDays(day, 1);
const highlightDates = [highlightDay1, highlightDay2];
const highlightDatesMap = getHightLightDaysMap(highlightDates);
const highlightDatesMap = getHighLightDaysMap(highlightDates);
const container = renderDay(day, { highlightDates: highlightDatesMap });
expect(
container
Expand All @@ -253,7 +253,7 @@ describe("Day", () => {
const highlightDay2 = addDays(day, 2);
const highlightDay3 = addDays(day, 3);
const highlightDates = [highlightDay1, highlightDay2, highlightDay3];
const highlightDatesMap = getHightLightDaysMap(highlightDates);
const highlightDatesMap = getHighLightDaysMap(highlightDates);
const container = renderDay(day, {
highlightDates: highlightDatesMap,
});
Expand All @@ -272,7 +272,7 @@ describe("Day", () => {
const highlightDay2 = addDays(day, 3);
const highlightDay3 = addDays(day, 4);
const highlightDates = [highlightDay1, highlightDay2, highlightDay3];
const highlightDatesMap = getHightLightDaysMap(highlightDates);
const highlightDatesMap = getHighLightDaysMap(highlightDates);
const container = renderDay(day, {
highlightDates: highlightDatesMap,
});
Expand All @@ -289,7 +289,7 @@ describe("Day", () => {
const highlightDay2 = { barClassName: [newDate(day)] };
const highlightDay3 = newDate(day);
const highlightDates = [highlightDay1, highlightDay2, highlightDay3];
const highlightDatesMap = getHightLightDaysMap(highlightDates);
const highlightDatesMap = getHighLightDaysMap(highlightDates);
const container = renderDay(day, {
highlightDates: highlightDatesMap,
});
Expand Down