Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] DatePickerSingle is extremely slow when using large number of disabled_days #1962

Closed
Bougeant opened this issue Mar 10, 2022 · 1 comment

Comments

@Bougeant
Copy link

Bougeant commented Mar 10, 2022

Describe your context
Please provide us your environment, so we can easily reproduce the issue.

dash                      2.0.0
dash-core-components      2.0.0
dash-extensions           0.0.67
dash-html-components      2.0.0
dash-table                5.0.0
jupyter-dash              0.4.0

OS: macOS
Browser: Chrome
Version: 96

Describe the bug

DatePickerSingle and DatePickerRange are extremely slow when provided a long list of disabled_days.

For example, if one wants to disabled every day between 2010 and 2022, except the first day of each month (4000+ disabled days), then the DatePickerSingle takes about 30 seconds to open and 30 additional seconds each time we change the month. This issue had already been reported here: plotly/dash-core-components#986

Here's a minimal reproducible example:

from dash import Dash, dcc
import pandas as pd


min_date = pd.to_datetime("2010-01-01")
max_date = pd.to_datetime("2022-01-01")
disabled_days = [x for x in pd.date_range(min_date, max_date, freq="D") if x.day != 1]

app = Dash()

app.layout = dcc.DatePickerSingle(
    min_date_allowed=min_date,
    max_date_allowed=max_date,
    disabled_days=disabled_days
)

app.run_server(port=8051)

Expected behavior

The DatePickerSingle should appear and be interactable instantly.

@Bougeant Bougeant changed the title [BUG] [BUG] DatePickerSingle is extremely slow when using large number of disabled_days Mar 10, 2022
@T4rk1n
Copy link
Contributor

T4rk1n commented Aug 3, 2022

Fixed by #1976

@T4rk1n T4rk1n closed this as completed Aug 3, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants