p-calendar and p-columnFilter with stateStorage : p-calendar somehow selects a UTC date which is not properly converted while restoring state #15131
Labels
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Describe the bug
This is a weird one :
I have a p-table, with state stored in the session storage. It has date filters.
JSON.stringify
it is stringified as"2024-03-01T00:00:00.0Z"
restoreState()
fails because it expects a timezone with 3 numbersOne of the fix would be to modify the regex to be
/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{1,3}Z/
in table.ts line 2813Here is the code for my table filter
Environment
Chrome version on Mac OS
Chrome Version 123.0.6312.59 (official build) (arm64) on MacOS
navigator.appVersion = '5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36'
Tested on safari too, the bug is still there
Angular / PrimeNG Version
Reproducer
No response
Angular version
16.1.2
PrimeNG version
16.0.2
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.5.1
Browser(s)
Chrome, Safari
Steps to reproduce the behavior
JSON.stringify
it is strigified as"2024-03-01T00:00:00.0Z"
Expected behavior
Date should not be UTC, or the regex used in the reviver function should handle it.
The text was updated successfully, but these errors were encountered: