Skip to content
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

docs: adjust example wording: "the today's date" #1987

Merged
merged 1 commit into from
Dec 7, 2023
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
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.');
});
});
Loading