Repository navigation
SaiSandeep Fix Calender for loss tracking - #5606
Open
saisandeepkoritala wants to merge 2 commits into
Open
saisandeepkoritala wants to merge 2 commits into
saisandeepkoritala wants to merge 2 commits into
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
The calendar feature in the Loss Tracking Line Chart is broken. The native
<input type="month">accepts invalid years (e.g.0020,0090), has a hidden native picker icon sitting under the custom icon, and behaves differently across browsers (Firefox has no month picker). This PR replaces the Start Date and End Date inputs with a custom month/year calendar picker for entering custom dates. It also fixes the chart legend overflowing outside the chart card and resolves the SonarCloud issues raised on these files.Implements # PR 5317 - Implement Calendar feature for the loss tracking line graph (Priority High)
Related PRS (if any):
This PR is related to PR #5016 → #5371 (Loss Tracking Line Chart). No backend PR is required.
Main changes explained:
MonthPicker.jsxfor introducing a custom month/year calendar picker (year navigation, month grid, Clear button, Esc/click-outside to close,<dialog>element for accessibility).LossTrackingLineChart.jsxfor replacing the native month inputs withMonthPicker, limiting selectable dates to the range in the data, and preventing the end date from being before the start date.LossTrackingLineChart.jsxfor fixing Sonar issues (localeComparein the sort compare function,.at(-1)instead of[length - 1]).LossTrackingLineChart.module.cssfor adding the calendar picker styles and the.chartAreawrapper, and removing the old nativeinput[type="month"]styles.How to test:
npm installandnpm startto run this PR locallyScreenshots or videos of changes:
Note:
Selectable dates are limited to the range available in the chart data (currently Jan 2022 to Jun 2024), so years like
0020can no longer be entered. If more data is added later, the range extends automatically.