-
Notifications
You must be signed in to change notification settings - Fork 38
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
[release-calendar] Calendar view date #821
base: main
Are you sure you want to change the base?
Conversation
} else { | ||
this.setState({singleEvents: []}); | ||
this.gotoDate(new Date()); |
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.
Curious, does Full Calendar have a "go to Today" button option? Going back to the current date when you remove filters might be unexpected, so I'm not sure we should do this. But having a "go to Today" button would help!
} else { | ||
this.setState({singleEvents: []}); | ||
} | ||
} | ||
} | ||
|
||
gotoDate = (date: Date): void => { |
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.
Is there a reason why you use an anonymous function here and not a regular function syntax? (gotoDate(date: Date): void {
)
Anonymous functions are more useful when you use them as, say, an argument to another function (e.g., arr.sort((firstEl, secondEl) => { ... })
)
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.
No there wasn't any reason. I just wasn't aware one was the "regular", and I've gotten used to the anonymous way since I use functions as arguments more often. I'll switch this one to the regular function syntax!
|
This will navigate the calendar to a relevant date when a release is selected.
Undesirable behavior: Let's say a user went to select a release, but was viewing the calendar in a different month than one where the requested release had been promoted in. Then, when they select to view the release, the calendar could appear empty.
Fix: Change the calendar to display the month of the latest release promotion when a release is selected. Also, when a release is unselected, return the viewer to the current month.
Included:
referenceCalendar
, in order to access theFullCalendar
methodgotoDate()
, https://fullcalendar.io/docs/Calendar-gotoDate.gotoDate(date: Date)
which uses thereferenceCalendar
to change the calendar view dategotoDate()
when theCalendar
componentsingleRelease
state is changedhandleReleaseClick()
inChannelTable
that I should have done long ago