PrimeReact > DataTable > Date Filter - Strip Timezone? #3245
-
I'm using the PrimeReact DataTable, and am trying to filter on a date column. I'm using PrimeReact's built-in UI but am doing custom stuff after the filter is set. This all works fine, except I'm getting the wrong data returned having filtered a date column. In the UI, I set the "Date Is" filter to 11 September 2013 (say). That just happens to be an example I'm using. Not even a hint of a time zone. But when I debug my code, what I'm seeing is "Wed Sep 11 2013 00:00:00 GMT+0100 (British Summer Time)". PrimeReact has added the time zone. I suppose it is being complete, but this causes me problems down the line because everything else in the app is UTC. I want to be able to turn this off. I just want to pass the date. Maybe just truncate, if necessary, but that feels obtuse and error-prone. I was wondering, does anybody know how to do this, perhaps just setting something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think its because PrimeReact does |
Beta Was this translation helpful? Give feedback.
I think its because PrimeReact does
new Date()
which will use your browsers timezone. There is this open ticket: primefaces/primereact#4128