Skip to content

Comments

feat(search): add date filters for created and updated fields in advanced search#204

Open
sreeshanth-soma wants to merge 2 commits intoopenbroadcaster:5.5-developfrom
sreeshanth-soma:search-by-date
Open

feat(search): add date filters for created and updated fields in advanced search#204
sreeshanth-soma wants to merge 2 commits intoopenbroadcaster:5.5-developfrom
sreeshanth-soma:search-by-date

Conversation

@sreeshanth-soma
Copy link
Member

Closes #80

Summary

Adds date-based advanced search filters for media in the sidebar, with support for both Created Date and Last Updated Date.

Changes

Backend

core/models/media_model.php

  • Added created and updated to allowed advanced-search filters.
  • Added SQL column mapping for:
    • created -> media.created
    • updated -> media.updated
  • Added day-aware date comparison handling for advanced filters:
    • is / eq: matches records within that full day
    • not / neq: excludes that full day
    • gte / lte / gt / lt: compares using day boundaries
  • Preserves existing operator behavior for non-date filters.

Frontend

public/html/sidebar/advanced_search.html

  • Added new filter options:
    • Created Date
    • Last Updated Date
  • Added date operator dropdown:
    • is on
    • is not on
    • is on or after
    • is on or before
  • Added date input field (type="date") for date filters.

public/js/sidebar.js

  • Added validation for date filter values (YYYY-MM-DD).
  • Added date filter description rendering in criteria list.

Behavior

  • Advanced Search now supports filtering media by:
    • Created Date
    • Last Updated Date
  • Date comparisons operate on full calendar days (not raw timestamp equality).
  • Existing simple search and non-date advanced filters are unchanged.

Verification

  • Open Sidebar -> Media -> Advanced Search.
  • Select Created Date, choose each operator (is on, is not on, is on or after, is on or before), set a date, and run search.
  • Repeat with Last Updated Date.
  • Confirm criteria chips/descriptions appear correctly and results match expected date-based behavior.
  • Confirm no regressions for existing advanced filters (artist/title/year/duration/etc.).
image image image

@sreeshanth-soma sreeshanth-soma changed the title feat: add date filters for created and updated fields in advanced search feat(search): add date filters for created and updated fields in advanced search Feb 19, 2026
@radiorob
Copy link
Member

Ensure that inputting the date is the same smart logic\process, such as scheduling items. ie Not a picker.

Updates advanced search to use `<ob-date-input>` for natural language date parsing, matching the scheduling UI.
@sreeshanth-soma
Copy link
Member Author

You are absolutely right about that. I have replaced the native date picker with the component, so it now uses the exact same smart date parsing logic as the scheduling items.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants