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

Off-by-one error max_date_allowed in dcc.DatePickerRange #1406

Closed
MattiasOlla opened this issue Sep 10, 2020 · 4 comments
Closed

Off-by-one error max_date_allowed in dcc.DatePickerRange #1406

MattiasOlla opened this issue Sep 10, 2020 · 4 comments
Labels
good first issue suitable for newcomers

Comments

@MattiasOlla
Copy link

In recent versions (can't say from exactly when), there seems to be an off-by-one error in dcc.DatePickerRange. I set max_date_allowed = datetime.today().date(), but in the calendar, yesterday is the maximum date allowed. I see it in my apps, and it is also present in the first example on the DatePickerRange documentation page.

Example:

html.Div(
        dcc.DatePickerRange(
            id="date_range",
            start_date_placeholder_text="Start Period",
            end_date_placeholder_text="End Period",
            max_date_allowed=datetime.today().date(),
            display_format="YYYY-MM-DD",
            first_day_of_week=1,
            clearable=True,
            minimum_nights=0,
            persistence=True,
        ),
    )

I've also tried connecting callbacks to State("date_range", "max_date_allowed"), and there the received max date is today's date, so it only appears in the frontend.

Tested with server under both Windows 10 1909 and Linux Mint 19.1, and in both Google Chrome 85.0 and Firefox 80.0. Versions:

dash==1.16.0
dash-core-components==1.12.0
dash-html-components==1.1.1
dash-renderer==1.8.0
dash-table==4.10.1
@ankh6
Copy link

ankh6 commented Mar 30, 2021

Hey @chriddyp I'd like to make my first contribution if the issue is free
I've searched for the module but have not found it. Could you redirect me to the relevant code section as I am not familiar (yet)
Are there other requirements in the scope of this issue ?

@sofiemor
Copy link

HI! Is this still available to work on?

@kevindehecker
Copy link

Isn't this fixed bij plotly/dash-core-components#930 ?

@Coding-with-Adam
Copy link
Contributor

Yes, this has been fixed by #930.

Thank you @kevindehecker

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue suitable for newcomers
Projects
None yet
Development

No branches or pull requests

7 participants
@chriddyp @kevindehecker @MattiasOlla @Coding-with-Adam @sofiemor @ankh6 and others