How to determine what is the currently viewed month
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 28/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, react
- Domain
- frontend
Research direction
Start by tracing the calendar navigation and the header value shown in the rdtSwitch element, then compare when onNavigateBack, onNavigateForward, onChange, and renderDay run. Done means the component provides a reliable way to identify the currently viewed month and year before day rendering, without updating state during render.
Written by the indexing model from the issue text.
Description
I need to augment the date picker with certain events (like public holidays should be green etc.) and render these on the days view. I'm struggling to find out the current month and year rendered in the view. Same date that is on the navigation bar as <th class="rdtSwitch">November 2021</th>
I tried certain things:
onNavigateBackandonNavigateForwardis not perfect as we have custom buttons allowing to set current date to e.g. "yesterday" which navigates the view to the current monthonChangeis worthless as at that point it is too late- Hover events also doesn't do justice as while navigating you might not hover over any day cells.
The only workaround I found is highjacking renderDay callback and saving the dates it renders. However that is an anti-pattern as it updates the component state before it finishes its render. Even React is complaining about it "Cannot update a component ("SomeComponent") while rendering a different component"
I'm using v2 but that shouldn't matter as looking into v3 docs there is still nothing that can help achieve my goal.
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 858
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from arqex/react-datetime
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
arqex/react-datetime#880 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
arqex/react-datetime#876 · 2 comments · 3 reactions ·
-
Disable past time Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
arqex/react-datetime#874 ·
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
arqex/react-datetime#873 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
arqex/react-datetime#871 · 3 comments ·
All issues in arqex/react-datetime
Similar issues
-
curation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
amponce/archive-movie-browser#186 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
clerk/javascript#9852 ·
-
bug p1 tools
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
Difficulty 2/5 1-3 hours Newbie friendliness 84/100