Skip to content

Commit

Permalink
docs: adjust example wording: "the today's date" (#1987)
Browse files Browse the repository at this point in the history
  • Loading branch information
toby-brilliant authored Dec 7, 2023
1 parent 7ddf1a1 commit d67a3f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions website/examples/modifiers-today.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import React, { useState } from 'react';
import { DayClickEventHandler, DayPicker } from 'react-day-picker';

export default function App() {
const initialFooter = <p>Try clicking the today’s date.</p>;
const initialFooter = <p>Try clicking today’s date.</p>;
const [footer, setFooter] = useState(initialFooter);

const handleDayClick: DayClickEventHandler = (day, modifiers) => {
if (modifiers.today) {
setFooter(<p>You clicked the today’s date.</p>);
setFooter(<p>You clicked today’s date.</p>);
} else {
setFooter(initialFooter);
}
Expand Down
6 changes: 2 additions & 4 deletions website/test-integration/examples/modifiers-today.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ describe('when rendering a month that contains today', () => {
describe('when the today date is clicked', () => {
beforeEach(async () => act(() => user.click(getDayButton(today))));
test('should update the footer', () => {
expect(getTableFooter()).toHaveTextContent('You clicked the today’s date');
expect(getTableFooter()).toHaveTextContent('You clicked today’s date');
});
});

describe('when another date is clicked', () => {
const date = addDays(today, 1);
beforeEach(async () => act(() => user.click(getDayButton(date))));
test('should update the footer', () => {
expect(getTableFooter()).toHaveTextContent(
'Try clicking the today’s date.'
);
expect(getTableFooter()).toHaveTextContent('Try clicking today’s date.');
});
});

0 comments on commit d67a3f8

Please sign in to comment.