josh_boaz
josh_boaz

Reputation: 2023

ui grid date cellfilter, filtering date format is causing wrong date to show up

http://plnkr.co/edit/2dJAoMULBKD6frSSW7FN?p=preview

Please have a look at the plunkr above

I have give data as

date = "2008-12-10T04:00:00.000Z"

and applied cellfilter

cellFilter: 'date:"yyyy-MM-dd HH:mm"',

however the ending result it is showing as 2008-12-09 23:00, it should show 2008-12-10 04:00?

Upvotes: 2

Views: 2194

Answers (1)

Claudio Lagoa
Claudio Lagoa

Reputation: 96

I think the problem is in the 'Z' that you putting in the strting Datetime. In this way you are indicating that this is a UTC date so that formatting transforms local.

You will get what you want if you change your code to:

date = "2008-12-10T04:00:00.000"

Upvotes: 1

Related Questions