Font Size:
Ask Joget AI

Applying a Date Range Filter to a List in UI

Introduction

In this scenario, committee meetings have both a start date and an end date, and the requirement is to filter meetings where either the start date or the end date falls within the selected date range. This can be implemented using a combination of List filter configuration and a Custom HTML date range input in the UI.

How does it work?

Joget allows the use of request parameters inside filter conditions. By exposing two date inputs in the UI and mapping their values to request parameters, the List can filter its records based on both start date and end date simultaneously. The configuration below demonstrates how to achieve this behaviour using out-of-the-box functionality.

  1. In the List Builder, go to Data > Advanced.
  2. Configure the Filter Conditions by adding the following filter rows:


    Row 1:
    • Join Type: And
    • Field: start_date
    • Operator: Greater Than Or Equal
    • Value: #requestParam.startDateFilter#
    Row 2:
    • Join Type: And
    • Field: end_date
    • Operator: Less Than Or Equal
    • Value: #requestParam.endDateFilter#
  3. In the UI Builder, go to the CRUD element and click on Edit Page Components.
  4. Drag an HTML Code element onto the page. Insert the following snippet into the HTML field:
    <div style="max-width: 305px; margin-left: auto; margin-bottom: 10px;"> 
        <label>Date Range Filter</label>
        <div style="display: flex;">
            <input type="date" name="startDateFilter" />
            <input type="date" name="endDateFilter" style="margin: 0 10px;" />
        </div>
    
        <script>
            $(document).ready(function () {
                const startDateFilterEl = document.querySelector('input[name="startDateFilter"]');
                const endDateFilterEl = document.querySelector('input[name="endDateFilter"]');
    
                startDateFilterEl.addEventListener('change', () => {
                    applyFilter();
                });
    
                endDateFilterEl.addEventListener('change', () => {
                    applyFilter();
                });
    
                function applyFilter() {
                    const startDateFilter = startDateFilterEl.value;
                    const endDateFilter = endDateFilterEl.value;
    
                    const url = new URL(window.location.href);
                    url.searchParams.set('startDateFilter', startDateFilter);
                    url.searchParams.set('endDateFilter', endDateFilter);
    
                    window.history.pushState({}, '', url.toString());
                }
    
                const url = new URL(window.location.href);
                const startDateFilter = url.searchParams.get('startDateFilter');
                const endDateFilter = url.searchParams.get('endDateFilter');
    
                if (startDateFilter) {
                    startDateFilterEl.value = startDateFilter;
                }
    
                if (endDateFilter) {
                    endDateFilterEl.value = endDateFilter;
                }
            });
        </script>
    </div>

  5. Click Done Editing Page Components, click Save, and click Launch to launch the app.

Expected Outcome

After saving the configuration and launching the app, the date range filter will work across both the start date and end date columns. Selecting a date range will update the URL parameters, refresh the list, and return all meetings whose start or end dates fall within the specified range.

  • Without the date range filters set:

  • Setting the date filters between 04/21/2026 and 04/30/2026 will show all meetings that are within those two dates:

Video Tutorial

Download sample app

Download the demo app for Date Range Filter:
Created by Debanraj Ravindran Last modified by Nurkhairini Fitrah on May 25, 2026