-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add functionality to see previous months for vertical scrollable calendar #1894
Add functionality to see previous months for vertical scrollable calendar #1894
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, pending comments! Perhaps add some stories as well?
What makes this a breaking change exactly? It seems like a semver-minor but I might be missing something. |
@ljharb Actually, I think you're right. I was thinking it was incompatible because it could mess up a user's calendar navigation, but I guess that's not really incompatibility |
@ljharb are there any additional stories you think would be helpful? Since this change doesn't rely on any props from the user I thought change to the existing vertical scrollable stories was enough |
oh if it's already accessible in existing stories, then there's def no point in adding more :-D i just saw no story files in the diff :-p |
const newVisibleDays = getVisibleDays(firstPreviousMonth, numberOfMonths, enableOutsideDays, true); | ||
|
||
this.setState({ | ||
currentMonth: firstPreviousMonth.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nkinser Is this why the calendar resets to the farthest date in the past? You're setting the currentMonth
to the firstPreviousMonth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevinthepan no, currentMonth
has to be set to firstPreviousMonth
in order for the previous months to be rendered. I think the reason it shows the earliest month is because when the past months are rendered they push the rest of the months down. I'm not sure how to get around that though
b6eaefa
to
a4226db
Compare
4ca51e0
to
fab0e1c
Compare
fab0e1c
to
a3e76fe
Compare
This PR adds the ability to view months before the current month when the calendar is vertically scrollable. There's a small issue where when you click to view more dates above the calendar shifts down and you see the farthest date in the past rather than staying on the month you were just viewing. I will try to fix this in a followup PR.
Before
After