Statistic: concrete date range selector (Today/Week/Month/All/Custom)#46
Statistic: concrete date range selector (Today/Week/Month/All/Custom)#46IanTheMitten wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2cd62afb0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| selected: eligibleDates | ||
| .filter((date) => isWithinRange(date, options)) | ||
| .sort((a, b) => a.getTime() - b.getTime()), |
There was a problem hiding this comment.
Honor preset dateRange when bounds are absent
getSampledTransactionDates now filters only by startDate/endDate, so any caller that provides only dateRange (for example the initial StatisticPage state { dateRange: 'thisMonth' }) gets all historical weekdays instead of the selected preset window until another update supplies concrete bounds. This produces incorrect chart/table values on initial render and can trigger unnecessary full-history aggregation work.
Useful? React with 👍 / 👎.
Motivation
Custommode with simple validation so users can pick an exact inclusive date interval used by downstream charts.Description
DateRangeSelectorto supportToday,This Week,This Month,All Time, andCustom, and to emit resolved windows viaonRangeResolvedChangeas{ dateRange, startDate?, endDate? }.Customwith parsing and validation that enforcesstart <= endand shows an inline error when invalid.StatisticPageto consume the selector output as a singleStatisticSamplingOptionsstate (dateRangeplus optionalstartDate/endDate) and removed the old chosen-month / seed props.analyticsSamplinglogic to remove seeded/random sampling and to filter eligible weekday dates by optionalstartDate/endDateinstead of sampling modes.Testing
npm run buildand the production build completed successfully.Codex Task