Skip to content

Support reusable date range filters#10506

Open
Montekkundan wants to merge 2 commits into
aces:mainfrom
Montekkundan:montek/10472-date-range-filter
Open

Support reusable date range filters#10506
Montekkundan wants to merge 2 commits into
aces:mainfrom
Montekkundan:montek/10472-date-range-filter

Conversation

@Montekkundan
Copy link
Copy Markdown
Contributor

Brief summary of changes

  • Adds a reusable DateRangeElement form component for min/max date filtering.
  • Extends shared table filtering and filter query-string handling to support <field>Min / <field>Max date range values.

Testing instructions (if applicable)

  • Open http://localhost:8000/candidate_list/?DoBMin=2000-01-01&DoBMax=2005-12-31 and confirm the DoB Minimum / DoB Maximum inputs are populated from the URL.
  • On Candidate List, change the DoB range and confirm the table filters to dates within the selected bounds and the URL updates with DoBMin / DoBMax.
  • On the Statistics dashboard, open chart filters and confirm Date Registered appears as a range control with Range Start / Range End.

Link(s) to related issue(s)

@github-actions github-actions Bot added Language: Javascript PR or issue that update Javascript code Module: statistics PR or issue related to statistics module Module: candidate_list PR or issue related to candidate_list module labels May 19, 2026
@Montekkundan Montekkundan marked this pull request as ready for review May 25, 2026 12:25
@kongtiaowang
Copy link
Copy Markdown
Contributor

@Montekkundan to pass the integration test, please modify the testing code like below:
--- a/modules/candidate_list/test/CandidateListTestIntegrationTest.php
+++ b/modules/candidate_list/test/CandidateListTestIntegrationTest.php
@@ -38,7 +38,7 @@ class CandidateListTestIntegrationTest extends LorisIntegrationTestWithCandidate
// advanced filter
static $scanDone = 'select[name="scanDone"]';
static $Participant = 'select[name="participantStatus"]';

  • static $dob = 'input[name="DoB"]';
  • static $dob = 'input[name="min"]';
    static $visitCount = 'input[name="visitCount"]';
    static $feedback = 'select[name="feedback"]';
    static $edc = 'input[name="edc"]';
    @@ -144,7 +144,7 @@ class CandidateListTestIntegrationTest extends LorisIntegrationTestWithCandidate
    WebDriverBy::Name("participantStatus")
    );
    $this->assertEquals("select", $participantsStatusOptions->getTagName());
  •       $dobOptions = $this->safeFindElement(WebDriverBy::Name("DoB"));
    
  •       $dobOptions = $this->safeFindElement(WebDriverBy::Name("min"));
          $this->assertEquals("input", $dobOptions->getTagName());
          // Not currently done
          //$this->assertEquals("date",$dobOptions->getAttribute("type"));
    

@@ -265,13 +265,6 @@ class CandidateListTestIntegrationTest extends LorisIntegrationTestWithCandidate
"Active",
'436'
);

  •    $this->_filterTest(
    
  •        self::$dob,
    
  •        self::$display,
    
  •        self::$clearFilter,
    
  •        "2003-06-30",
    
  •        '1 row'
    
  •    );
       $this->_filterTest(
    

@github-actions github-actions Bot added the Language: PHP PR or issue that update PHP code label May 27, 2026
@skarya22
Copy link
Copy Markdown
Contributor

Thanks @kongtiaowang !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: Javascript PR or issue that update Javascript code Language: PHP PR or issue that update PHP code Module: candidate_list PR or issue related to candidate_list module Module: statistics PR or issue related to statistics module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[JSX] Add a Date Range filter

4 participants