plotly / plotly/dash

DatePickerSingle misleading Docs

Open
#2,657 0 comments 0 reactions 1 assignee View on GitHub

@LiamConnors is already working on this.

Since Jul 25, 2024.

bug P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

Describe the bug

The latest documentation discourages using datetime.datetime objects for the DatePickerSingle for a convincing reason

If you are using date objects, we recommend using datetime.date so there is no time part. dcc.DatePickerSingle accepts dates with a time part, but this can be confusing, particularly for the initial call of a callback. After the user chooses a new date, there will be no time part—only the date.

(c.f. https://dash.plotly.com/dash-core-components/datepickersingle).

However, the docs for parameter date encourage to use datetimes. best practice is to pass value via datetime object.
(https://dash.plotly.com/dash-core-components/datepickersingle#datepickersingle-properties). This seems to contradict each other.

Expected behavior

Unambiguous documentation. The documentation of the date parameter should be changed to best practice is to pass value via date object.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.