# Calendar > Implement a working month calendar in `App.tsx` — the calendar components are provided, so you focus on rendering the correct days, highlighting today, navigating between months, and handling leap years with plain JavaScript date math. - Difficulty: intermediate - Tags: useState, date - Estimated time: 45 minutes - Tests: 16 - Requires subscription: yes ## Overview Implement a working month calendar in `App.tsx` — the calendar components are provided, so you focus on rendering the correct days, highlighting today, navigating between months, and handling leap years with plain JavaScript date math. ## Requirements - Render the app title "Calendar" and the weekday header (`Mon` through `Sun`). - Show the current month and year in the header (e.g. `August 2026`). - Render the correct number of days for the selected month (28, 29, 30, or 31). - Place the 1st day of the month in the correct weekday column. - Fill the empty cells with days from the previous and next month so the grid always completes full weeks, dimming those days visually. - Navigate to the previous month. - Navigate to the next month. - Highlight the current day (today) in the grid. - Change the year correctly when navigating past December or before January. - Handle leap years correctly (February has 29 days in a leap year and 28 otherwise). ## Notes - `Components.tsx` is read-only — components, props, and `data-testid` attributes are already wired. Implement everything in `App.tsx`. - Day `0` of a month is the last day of the previous month, so `new Date(year, month + 1, 0).getDate()` returns the number of days in `month` (leap years included). - `new Date(year, month, 1).getDay()` returns the weekday of the 1st (0 = Sunday). The week starts on Monday, so the leading-day offset is `(getDay() + 6) % 7`. - Navigate with `new Date(year, month + offset, 1)` — JavaScript rolls the year over automatically. - Use `new Date()` for the initial month and to flag today's date. ## Tests 01. renders the app title 02. renders the seven weekday labels 03. shows the current month and year in the header 04. renders the correct number of days for the current month 05. places the 1st day on the correct weekday 06. fills the grid with days from the previous and next month 07. navigates to the next month 08. navigates to the previous month 09. changes the year when navigating past December 10. changes the year when navigating before January 11. highlights today's date 12. does not highlight any day when viewing another month 13. renders 28 days for February in a non-leap year 14. renders 29 days for February in a leap year 15. renders 30 days for a 30-day month 16. uses five weeks when the month fits in five