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

Calendar not working under form submission #39

Open
Gabsys opened this issue Oct 15, 2024 · 1 comment
Open

Calendar not working under form submission #39

Gabsys opened this issue Oct 15, 2024 · 1 comment

Comments

@Gabsys
Copy link

Gabsys commented Oct 15, 2024

I am testing out with the demo usage's calendar code. When I place the code at the root indent level, it works. But when I place it under form submission like:

if input_form_submitted:
    calendar_options = {
        "editable": "true",
        "selectable": "true",
        "headerToolbar": {
            "left": "today prev,next",
            "center": "title",
            "right": "resourceTimelineDay,resourceTimelineWeek,resourceTimelineMonth",
        },
        "slotMinTime": "06:00:00",
        "slotMaxTime": "18:00:00",
        "initialView": "resourceTimelineDay",
        "resourceGroupField": "building",
        "resources": [
            {"id": "a", "building": "Building A", "title": "Building A"},
            {"id": "b", "building": "Building A", "title": "Building B"},
            {"id": "c", "building": "Building B", "title": "Building C"},
            {"id": "d", "building": "Building B", "title": "Building D"},
            {"id": "e", "building": "Building C", "title": "Building E"},
            {"id": "f", "building": "Building C", "title": "Building F"},
        ],
    }
    calendar_events = [
        {
            "title": "Event 1",
            "start": "2023-07-31T08:30:00",
            "end": "2023-07-31T10:30:00",
            "resourceId": "a",
        },
        {
            "title": "Event 2",
            "start": "2023-07-31T07:30:00",
            "end": "2023-07-31T10:30:00",
            "resourceId": "b",
        },
        {
            "title": "Event 3",
            "start": "2023-07-31T10:40:00",
            "end": "2023-07-31T12:30:00",
            "resourceId": "a",
        },
    ]
    calendar(
        events=calendar_events,
        options=calendar_options,
    )

The calendar wouldn't work

@tabedzki
Copy link
Contributor

tabedzki commented Feb 1, 2025

If this is still a problem, please provide a minimum reproducible example that others can download and run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants