Skip to content

DateTime transforms ISO time string without timezone into UTC #8009

@zmbc

Description

@zmbc

Short description of the problem:

When I use an <ion-datetime> and set the initial value to an ISO time string without a timezone (e.g. 2016-07-03T15:30), after changing the time the string now has a 'Z' at the end signifying UTC.

What behavior are you expecting?

It says in the Ionic docs:

Any of the ISO formats below can be used, and after a user selects a new value, Ionic will continue to use the same ISO format which datetime value was originally given as.
...
Date and Time | YYYY-MM-DDTHH:mm | 1994-12-15T13:47

I would expect, then, for my format (YYYY-MM-DDTHH:mm) to remain the same. Sorry if I have misunderstood this. If my issue is expected behavior, then I guess the docs should be updated.

Steps to reproduce:

  1. Initialize an <ion-datetime> with an ISO string without a timezone specified.
  2. Change the date using the picker.

Which Ionic Version?

2.x

Plunker that shows an example of your issue

http://plnkr.co/edit/w0aio9JY1osYKzOJaqtd?p=preview

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions