-
Notifications
You must be signed in to change notification settings - Fork 3
feature/AB#31737 Enhanced Date Filter #2017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,6 +7,8 @@ | |||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| const formatter = createNumberFormatter(); | ||||||||||||||||||||||||||||||||||||||||||||
| const l = abp.localization.getResource('GrantManager'); | ||||||||||||||||||||||||||||||||||||||||||||
| const defaultQuickDateRange = 'last6months'; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| let dt = $('#GrantApplicationsTable'); | ||||||||||||||||||||||||||||||||||||||||||||
| let dataTable; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -92,6 +94,22 @@ | |||||||||||||||||||||||||||||||||||||||||||
| dt.search(''); | ||||||||||||||||||||||||||||||||||||||||||||
| dt.order(initialSortOrder).draw(); | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // Reset date range filters | ||||||||||||||||||||||||||||||||||||||||||||
| $('#quickDateRange').val(defaultQuickDateRange); | ||||||||||||||||||||||||||||||||||||||||||||
| toggleCustomDateInputs(defaultQuickDateRange === 'custom'); | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| const range = getDateRange(defaultQuickDateRange); | ||||||||||||||||||||||||||||||||||||||||||||
| if (range) { | ||||||||||||||||||||||||||||||||||||||||||||
| UIElements.submittedFromInput.val(range.fromDate); | ||||||||||||||||||||||||||||||||||||||||||||
| UIElements.submittedToInput.val(range.toDate); | ||||||||||||||||||||||||||||||||||||||||||||
| grantTableFilters.submittedFromDate = range.fromDate; | ||||||||||||||||||||||||||||||||||||||||||||
| grantTableFilters.submittedToDate = range.toDate; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| localStorage.setItem('GrantApplications_FromDate', range.fromDate); | ||||||||||||||||||||||||||||||||||||||||||||
| localStorage.setItem('GrantApplications_ToDate', range.toDate); | ||||||||||||||||||||||||||||||||||||||||||||
| localStorage.setItem('GrantApplications_QuickRange', defaultQuickDateRange); | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // Close the dropdown | ||||||||||||||||||||||||||||||||||||||||||||
| dt.buttons('.grp-savedStates') | ||||||||||||||||||||||||||||||||||||||||||||
| .container() | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -164,50 +182,41 @@ const listColumns = getColumns(); | |||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| function initializeSubmittedFilterDates() { | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| const fromDate = localStorage.getItem('GrantApplications_FromDate'); | ||||||||||||||||||||||||||||||||||||||||||||
| const toDate = localStorage.getItem('GrantApplications_ToDate'); | ||||||||||||||||||||||||||||||||||||||||||||
| const savedRange = localStorage.getItem('GrantApplications_QuickRange') || defaultQuickDateRange; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // Check if localStorage has values and use them | ||||||||||||||||||||||||||||||||||||||||||||
| // Set the dropdown value | ||||||||||||||||||||||||||||||||||||||||||||
| $('#quickDateRange').val(savedRange); | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // Show/hide custom date inputs based on saved selection | ||||||||||||||||||||||||||||||||||||||||||||
| toggleCustomDateInputs(savedRange === 'custom'); | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // If we have saved dates, use them | ||||||||||||||||||||||||||||||||||||||||||||
| if (fromDate && toDate) { | ||||||||||||||||||||||||||||||||||||||||||||
| UIElements.submittedFromInput.val(fromDate); | ||||||||||||||||||||||||||||||||||||||||||||
| UIElements.submittedToInput.val(toDate); | ||||||||||||||||||||||||||||||||||||||||||||
| grantTableFilters.submittedFromDate = fromDate; | ||||||||||||||||||||||||||||||||||||||||||||
| grantTableFilters.submittedToDate = toDate; | ||||||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||
| const range = getDateRange(defaultQuickDateRange); | ||||||||||||||||||||||||||||||||||||||||||||
| if (range?.fromDate && range?.toDate) { | ||||||||||||||||||||||||||||||||||||||||||||
| UIElements.submittedFromInput.val(range.fromDate); | ||||||||||||||||||||||||||||||||||||||||||||
| UIElements.submittedToInput.val(range.toDate); | ||||||||||||||||||||||||||||||||||||||||||||
| grantTableFilters.submittedFromDate = range.fromDate; | ||||||||||||||||||||||||||||||||||||||||||||
| grantTableFilters.submittedToDate = range.toDate; | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+202
to
+207
|
||||||||||||||||||||||||||||||||||||||||||||
| const range = getDateRange(defaultQuickDateRange); | |
| if (range?.fromDate && range?.toDate) { | |
| UIElements.submittedFromInput.val(range.fromDate); | |
| UIElements.submittedToInput.val(range.toDate); | |
| grantTableFilters.submittedFromDate = range.fromDate; | |
| grantTableFilters.submittedToDate = range.toDate; | |
| // No saved dates: derive range from the saved quick range selection | |
| if (savedRange === 'alltime') { | |
| // "All time" should have no date bounds | |
| UIElements.submittedFromInput.val(''); | |
| UIElements.submittedToInput.val(''); | |
| grantTableFilters.submittedFromDate = null; | |
| grantTableFilters.submittedToDate = null; | |
| } else { | |
| const range = getDateRange(savedRange); | |
| if (range?.fromDate && range?.toDate) { | |
| UIElements.submittedFromInput.val(range.fromDate); | |
| UIElements.submittedToInput.val(range.toDate); | |
| grantTableFilters.submittedFromDate = range.fromDate; | |
| grantTableFilters.submittedToDate = range.toDate; | |
| } |
Copilot
AI
Feb 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling: "formated" in the comment should be "formatted".
| // Returns a formated { fromDate, toDate } for the filter fields. | |
| // Returns a formatted { fromDate, toDate } for the filter fields. |
Copilot
AI
Feb 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleInputFilterChange() forces the quick range to custom but does not call toggleCustomDateInputs(true). If the date inputs are changed programmatically (or a change event fires while the custom container is hidden), the dropdown can switch to "Custom" while the custom inputs remain hidden, leaving the UI in an inconsistent state.
| localStorage.setItem('GrantApplications_QuickRange', 'custom'); | |
| localStorage.setItem('GrantApplications_QuickRange', 'custom'); | |
| // Ensure the custom date inputs are visible when quick range is set to custom | |
| toggleCustomDateInputs(true); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,29 +17,43 @@ | |
| <div class="search-action-bar_search-wrapper"> | ||
| <input type="search" id="search" placeholder="Search" class="tbl-search"> | ||
| <div class="mb-3 date-input-filter-div"> | ||
| <label class="form-label" for="SubmittedFromDate">Submission Date From</label> | ||
| <input | ||
| abp-data-datepicker="false" | ||
| type="date" | ||
| id="submittedFromDate" | ||
| name="SubmittedFromDate" | ||
| value="" | ||
| class="form-control date-input-filter" | ||
| min="1900-01-01" | ||
| max="2100-01-01"> | ||
| <label class="form-label" for="quickDateRange">Quick Date Range</label> | ||
| <select id="quickDateRange" class="form-control"> | ||
| <option value="today">Today</option> | ||
| <option value="last7days">Last 7 days</option> | ||
| <option value="last30days">Last 30 days</option> | ||
| <option value="last3months">Last 3 months</option> | ||
| <option value="last6months" selected>Last 6 months</option> | ||
| <option value="alltime">All time</option> | ||
| <option value="custom">Custom Ranges</option> | ||
| </select> | ||
| </div> | ||
| <div class="mb-3 custom-date-range-container-div" id="customDateInputs" style="display: none;"> | ||
| <div class="mb-3 date-input-filter-div"> | ||
| <label class="form-label" for="SubmittedFromDate">Submission Date From</label> | ||
| <input | ||
| abp-data-datepicker="false" | ||
| type="date" | ||
| id="submittedFromDate" | ||
| name="SubmittedFromDate" | ||
| value="" | ||
| class="form-control date-input-filter" | ||
| min="1900-01-01" | ||
| max="2100-01-01"> | ||
| </div> | ||
| <div class="mb-3 date-input-filter-div"> | ||
| <label class="form-label" for="SubmittedToDate">Submission Date To</label> | ||
| <input | ||
| abp-data-datepicker="false" | ||
| type="date" | ||
| id="submittedToDate" | ||
| name="SubmittedToDate" | ||
|
Comment on lines
+33
to
+50
|
||
| value="" | ||
| class="form-control date-input-filter" | ||
| min="1900-01-01" | ||
| max="2100-01-01"> | ||
| </div> | ||
| </div> | ||
| <div class="mb-3 date-input-filter-div"> | ||
| <label class="form-label" for="SubmittedToDate">Submission Date To</label> | ||
| <input | ||
| abp-data-datepicker="false" | ||
| type="date" | ||
| id="submittedToDate" | ||
| name="SubmittedToDate" | ||
| value="" | ||
| class="form-control date-input-filter" | ||
| min="1900-01-01" | ||
| max="2100-01-01"> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="btn-group" id="app_custom_buttons"> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reset-to-default-view action is resetting
#quickDateRangeback tolast6monthsand overwritingGrantApplications_QuickRangein localStorage. This conflicts with the PR description/acceptance note that clearing all filters should not reset the quick date range filter—either update the implementation to preserve the current quick range or update the PR description/behavior expectation to match.