Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

bug(datepicker): Time Zone transformation applied when it shouldn't #1031

Closed
@thardy

Description

@thardy

According to ISO 8601, "If no UTC relation information is given with a time representation, the time is assumed to be in local time". The UI-Bootstrap datepicker is not honoring that specification.

Dates in the following formats are coming back from the webapi we're using - 2013-09-01T00:00:0. This is standard format for a date that has no time or time zone information. Notice the lack of a "Z" or "+00" at the end.

Start with your own plunker for the datepicker (on docs page) and paste this time into the input box - 2013-09-04T00:00:00.000. It's obviously a date representation for September 4th, but notice the datepicker popup shows September 3 as the date. You're applying time zone transformation to a date that according to spec should be assumed to be in the same time zone (i.e. DON'T MESS WITH IT).

This is a big problem, causing every date to display as the prior day. I'm amazed no one has used the datepicker with an api, or this would be seen. Perhaps you're apis are explicity specifying the time zone. I'm not sure we can get that changed, but regardless it should work according to ISO.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions