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.

Allow for monthsShown to be either next or previous to selected, or to default before maxDate.

See original GitHub issue

Expected behavior

When I use monthsShown={2} and maxDate={today}, I would like to be shown current month and previous month

Actual behavior

Current month and next month are shown.

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:6

github_iconTop GitHub Comments

4reactions
timkindbergcommented, Sep 13, 2019

I’d rather just have it be based on what integer is passed to monthsShown. We’d need to add support for negative integer and 0 becomes the ‘current’ month. By default it would include 0-n where n is the number provided, but you could also provide an array tuple (array of two integers) to explicitly define exactly which month range to show.

Some examples

  • monthsShown={0} - default, show the current month
  • monthsShown={1} - show the current month and next month
  • monthsShown={-1} - show the current month and previous month
  • monthsShown={[1,2]} - show the next month and the month after that
  • monthsShown={[-2,-1]} - show two months ago and the previous month
  • monthsShown={[-1,1]} - show previous, current and next month

Just an idea!!

1reaction
siva-osvcommented, Dec 29, 2020

when using this flag with monthsShown and selectsRange, on Date select I am going to the previous month. is there any feasible solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-datepicker, issue with monthsShown by default
the default months shown is controlled by monthsShown datepicker component property. when we say 2- it shows Current Month + Next Month. I...
Read more >
Datepicker Widget - jQuery UI API Documentation
By default, the datepicker calendar opens in a small overlay when the associated text ... ui-datepicker-prev : The control used to select previous...
Read more >
Date slider to automatically update to the max date
I am currently on tableau 10.3.2 and i am wondering if there is a way to automatically update the dates on the date...
Read more >
jQuery UI Datepicker
By default, the datepicker calendar opens in a small overlay onFocus and closes ... This allows one date format to be shown to...
Read more >
DatepickerOptions | PrimeFaces JavaScript API Docs
This allows one date format to be shown to the user for selection purposes ... The function is called for each day in...
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