angularUtils icon indicating copy to clipboard operation
angularUtils copied to clipboard

ordinalDate filter: Showing a date one day earlier

Open daniel-nelson opened this issue 10 years ago • 3 comments

Returning JSON such as my_date: '2015-02-24'. Showing via {{my_date | ordinalDate:'MMMM d'}} resulted in "February 23rd". Changing to {{my_date | date:'MMMM d'}} showed the correct date of "February 24".

Perhaps this is due to timezone differences (eg: since converting a date to a time ends up at the beginning of the day, and then in the States, we have a negative offset, putting us into the previous day).

daniel-nelson avatar Feb 24 '15 20:02 daniel-nelson

Thanks for the report. I'll look into this properly when I have more time later this week, hopefully. I somewhat dread getting into the murky world of date-time manipulation in JS. But I'll give it a go...

michaelbromley avatar Mar 09 '15 09:03 michaelbromley

Ran into this issue running the tests. I suspect this is due to an unspecified time zone. I'll try to address as time permits. If someone beats me to it, I'd be happy to verify.

LoganBarnett avatar Apr 10 '15 20:04 LoganBarnett

Yeah I've not yet had time to look into this - so please go ahead if you get time.

michaelbromley avatar Apr 11 '15 09:04 michaelbromley