-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensures Calendar.List always show the right active date ranges (#14)
- Loading branch information
1 parent
0aeb960
commit 5363835
Showing
4 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@marceloterreiro/flash-calendar": patch | ||
--- | ||
|
||
Fix `<Calendar.List />` losing track of the active date ranges when the list is scrolled past certain amount |
35 changes: 35 additions & 0 deletions
35
apps/example/src/components/GithubIssues/CalendarListGithubIssues.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Calendar } from "@marceloterreiro/flash-calendar"; | ||
import type { Meta } from "@storybook/react"; | ||
|
||
const CalendarMeta: Meta<typeof Calendar> = { | ||
title: "Calendar.List/Github Issues", | ||
decorators: [], | ||
}; | ||
|
||
export default CalendarMeta; | ||
|
||
// See more: https://github.com/MarceloPrado/flash-calendar/issues/11 | ||
export const Issue11 = () => { | ||
const act = [ | ||
{ endId: "2024-01-31", startId: "2024-01-30" }, | ||
{ endId: "2024-01-12", startId: "2024-01-10" }, | ||
{ endId: "2024-03-07", startId: "2024-02-28" }, | ||
{ endId: "2024-04-10", startId: "2024-04-01" }, | ||
{ endId: "2024-01-19", startId: "2024-01-18" }, | ||
{ endId: "2024-02-06", startId: "2024-02-02" }, | ||
{ endId: "2024-01-26", startId: "2024-01-25" }, | ||
{ endId: "2024-01-05", startId: "2024-01-02" }, | ||
]; | ||
const dis = ["2024-02-02", "2024-02-06", "2024-02-19", "2024-02-27"]; | ||
|
||
return ( | ||
<Calendar.List | ||
calendarActiveDateRanges={act} | ||
calendarDisabledDateIds={dis} | ||
calendarFormatLocale="de-DE" | ||
onCalendarDayPress={(day) => { | ||
console.log("pressed"); | ||
}} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters