question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to specify defaults for individual date pickers in DatePickerRange

See original GitHub issue

Currently, my date range is fed an existing date range based on the data being displayed, however, there is no way to individually set the initial visible month for each of the date pickers. Especially if the data displayed is historical this is problematic as you have to set either the start date / end date as the initial visible month

ezgif com-video-to-gif

To replicate this:

dcc.DatePickerRange(
    id='date-picker-range',
    start_date = dt(2017, 1, 31),
    end_date = dt(2018, 3, 21),
    min_date_allowed = dt(2017, 1, 31),
    max_date_allowed = dt(2018, 3, 21),
    initial_visible_month =  start_date=dt(2017, 1, 31)
)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Sheilecommented, Jun 13, 2020

@davenewham

That function isn’t works correctly. initial_visible_month is already converted by convertToMoment. convertToMoment handle falsy values like null and convert to not null value in following code. https://github.com/plotly/dash-core-components/blob/dev/src/utils/convertToMoment.js#L10-L21

Therefore, that function for initialVisibleMonth will receive non-null value even if specify None to initial_visible_month in python code.

0reactions
karanrajagopalancommented, Jan 21, 2022

Facing the same issue. Stumbled upon this bug report 😃 We need something like final_visible_month or end_visible_month

https://www.loom.com/share/dc2c40e8a0f946ab91eda321d332ef38

Read more comments on GitHub >

github_iconTop Results From Across the Web

Daterangepicker default dates not working [Invalid date]
You can fix this issue by just setting the locale option for the daterangepicker to 'YYYY-MM-DD' , the same format that you are...
Read more >
Can I dynamically set default value to date picker?
Hello,. After creating a date-picker, there is an option to set the "Default Value" for it. And this is a static value.
Read more >
Date Range Picker for Bootstrap
The Date Range Picker can be turned into a single date picker widget with only one calendar. In this example, dropdowns to select...
Read more >
react-bootstrap-daterangepicker - npm
A date/time picker for react (using bootstrap). This is a react port of: https://github.com/dangrossman/bootstrap-daterangepicker.
Read more >
Unable to set datepicker initial value - OutSystems
i am using datepicker from outsystems UI(version is 2.9.0.but i have initialized the date Field value in Initialized event but when it is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found