Skip to content

Commit

Permalink
Merge pull request #4808 from Hacker0x01/fix-typo
Browse files Browse the repository at this point in the history
Breaking: Fix typo of the name of the function getHightLightDaysMap w…
  • Loading branch information
martijnrusschen authored May 22, 2024
2 parents 14f6610 + 84d568b commit ff3607c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
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

0 comments on commit ff3607c

Please sign in to comment.