Skip to content

Date column filters cannot take in strings to compare #8506

@StevenReale

Description

@StevenReale

Describe the bug

DataTable Date column filters break if a) the column data are strings, which is common when collecting data from an API that transmits as JSON; or b) the filters use some input type other than DatePicker that does not return a Date object, such as a native <input type="date"> element.

Pull Request Link

#8505

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/primevue-4-vite-issue-template-oumlqotx?file=src%2FApp.vue

Environment

Happens on any environment

Vue version

3.5.22

PrimeVue version

4.4.1

Node version

No response

Browser(s)

No response

Steps to reproduce the behavior

  1. Create a DataTable with a Column for dates.
  2. Add a filter for the column
  3. Populate table with string data
  4. Attempt to filter by date
  5. Console error and table does not filter

Expected behavior

Table would filter by the date provided, even if it is a string type.

Metadata

Metadata

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions