Skip to content

Commit

Permalink
feat: support recurring events with rrule plugin (#29)
Browse files Browse the repository at this point in the history
* add feature: support recurring events with rrule plugin
---------

Co-authored-by: Jingyuan <[email protected]>
Co-authored-by: Muhammad Luqman <[email protected]>
  • Loading branch information
3 people authored Mar 28, 2024
1 parent 6f2eecb commit d9f1065
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
13 changes: 13 additions & 0 deletions streamlit_calendar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,19 @@ def calendar(
"end": "2023-07-17T16:30:00",
"resourceId": "e",
},
{
"title": "Event 18",
"color": "#3D9DF3",
"duration": "00:40",
"resourceId": "a",
"rrule": {
"freq": 'weekly',
"byweekday": [ 'tu', 'we' ],
"interval": 1,
"dtstart": '2023-07-04T10:00:00', # will also accept '20120201T103000'
"until": '2023-07-20' # will also accept '20120201'
}
},
]
calendar_resources = [
{"id": "a", "building": "Building A", "title": "Room A"},
Expand Down
33 changes: 26 additions & 7 deletions streamlit_calendar/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions streamlit_calendar/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@fullcalendar/resource-daygrid": "^6.1.9",
"@fullcalendar/resource-timegrid": "^6.1.9",
"@fullcalendar/resource-timeline": "^6.1.9",
"@fullcalendar/rrule": "^6.1.9",
"@fullcalendar/scrollgrid": "^6.1.9",
"@fullcalendar/timegrid": "^6.1.9",
"@fullcalendar/timeline": "^6.1.9",
Expand Down
2 changes: 2 additions & 0 deletions streamlit_calendar/frontend/src/components/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import resourceTimeGridPlugin from "@fullcalendar/resource-timegrid" // premium
import resourceTimelinePlugin from "@fullcalendar/resource-timeline" // premium
import timeGridPlugin from "@fullcalendar/timegrid"
import timelinePlugin from "@fullcalendar/timeline" // premium
import rrulePlugin from "@fullcalendar/rrule"; //

import {
CalendarOptions,
Expand Down Expand Up @@ -51,6 +52,7 @@ const ENABLED_PLUGINS = [
resourceTimelinePlugin,
timeGridPlugin,
timelinePlugin,
rrulePlugin,
]

const FullCalendarWrapper = styled.div<{ $customCSS?: string }>`
Expand Down

0 comments on commit d9f1065

Please sign in to comment.