#15684·primeng

Table Column Filter: Date is after sets hours to 00:00

Author: r3ps4JCreated May 23, 2024Updated Sep 21, 2026
LabelsResolution: Help Wanted

Describe the bug

If you use filter date is after the date object's hours is set to 00:00. You can see the line of code doing this here: https://github.com/primefaces/primeng/blob/3d5b78ecac68e3b0bb3ef4417c9fc2be3a3fd19d/src/app/components/api/filterservice.ts#L253

I get that this is intentional, but instead of updating the actual date object I want to propose to use something a copy of the object. Not sure why this wasn't done before, as now you update data that you probably don't want to update. I might open a pull request myself if I find the time as this is 2 lines of codes to change.

Environment

Not relevant as it's hardcoded to set the time to 00:00.

But I noticed this error in a table using column filter.

Reproducer

No response

Angular version

^17.3.0

PrimeNG version

^17.17.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v18.17.0

Browser(s)

No response

Steps to reproduce the behavior

  1. Filter a date with "Date is after".
  2. See the time being changed on all rows.

Expected behavior

The time should not be changed on the original object.