Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Datahub Collected filter labels rolling windows as This week, This month and This year

Open Beginner friendly
#1,785 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript
Domain
frontend

Research direction

Start with apps/web/src/routes/_app/datahub/subjects/index.tsx, especially the option labels at lines 249–256 and presetMinDate at lines 61–80; compare them with datahub.visualization.timeframeOptions. Run the named subjects test, apps/web/src/routes/_app/datahub/subjects/__tests__/index.test.tsx, to check the labels against the rolling windows. Done when the labels accurately describe the applied periods, with the relevant test passing.

Written by the indexing model from the issue text.

Description

Area: Web Bug Difficulty: Low Good First Issue Priority: Low

The datahub's "Collected" filter offers "This week", "This month" and "This year", but these apply rolling windows: the past 7 days, the past month and the past 12 months (presetMinDate subtracts 7 days, 1 month and 1 year from now). Read as calendar periods, the labels select the wrong subjects. On 7 October, "This month" also includes subjects last seen on 8–30 September, and on 5 January "This year" includes most of the previous year. The other options are worded as spans ("3 months", "6 months", "2 years"), and the subject Graph and Table tabs label the same computation "Past Month" / "Past Year" (datahub.visualization.timeframeOptions). A user narrowing a cohort to "this month" for a monthly report gets a different set of subjects than they asked for, with nothing to show the window is rolling.

Where

apps/web/src/routes/_app/datahub/subjects/index.tsx:249-256:

<option value="all">{t({ en: 'Any time', es: 'Cualquier fecha', fr: 'Toute période' })}</option>
<option value="pastWeek">{t({ en: 'This week', es: 'Esta semana', fr: 'Cette semaine' })}</option>
<option value="pastMonth">{t({ en: 'This month', es: 'Este mes', fr: 'Ce mois-ci' })}</option>
<option value="pastThreeMonths">{t({ en: '3 months', es: '3 meses', fr: '3 mois' })}</option>
<option value="pastSixMonths">{t({ en: '6 months', es: '6 meses', fr: '6 mois' })}</option>
<option value="pastYear">{t({ en: 'This year', es: 'Este año', fr: 'Cette année' })}</option>

and the windows they map to, index.tsx:61-80:

case 'pastMonth':
  return monthsAgo(1);
// ...
case 'pastWeek':
  return new Date(new Date(now).setDate(now.getDate() - 7));
case 'pastYear':
  return yearsAgo(1);

Reproduce

  1. Have a subject whose last record was collected on 20 September and another on 3 October.
  2. On 7 October, open Datahub → Subjects → Filters and set Collected to "This month".

Actual: both subjects are listed.
Expected: only the subject collected in October is listed, or, if the rolling window is intended, the option reads "Past month" (and "Past week", "Past year") like the subject graph's timeframe menu.

Tests

  • apps/web/src/routes/_app/datahub/subjects/__tests__/index.test.tsx: it('should label the rolling collected windows as past periods, so they are not read as calendar months'), or, if calendar periods are chosen, it('should start the This month window on the first of the month') with fake timers.
  • testing/src/specs/datahub.spec.ts: select the month preset and assert the option text matches the window applied.

Suggested fix

Relabel the three options "Past week", "Past month", "Past year" (es: "Última semana", "Último mes", "Último año"; fr: "Semaine écoulée", "Mois écoulé", "Année écoulée", matching datahub.json), so all presets describe spans. Alternatively, keep the labels and compute calendar boundaries in presetMinDate.

Dominant language
TypeScript
Stars
119
Forks
19
Avg merge
1d 2h
Merged PRs (30d)
56

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DouglasNeuroInformatics/OpenDataCapture

All issues in DouglasNeuroInformatics/OpenDataCapture

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.