Skip to content

Timezone issue on ng-model bind #42

@tux1337

Description

@tux1337

I have a web formular which loads previously saved values to a datetimepicker field.

When I bind the saved value to the ng-model of the field, for example:
2018-06-07T21:15:00.000Z
it is shown as UTC in the formular and is not calculated to my timezone which it works when I pick it over the picker dialog.

If I save this value once more, it is calculated from my current timezone to a UTC value which changes the loaded value (in my case) to:
2018-06-07T19:15:00.000Z

Implementation of the field:
<input mdc-datetime-picker date="true" time="true" type="text" id="time" short-time="true" placeholder="soon as possible" click-outside-to-close="false" auto-ok="true" min-date="StartTimeMinDate" max-date="StartTimeMaxDate" format="YYYY-MM-DD HH:mm" ng-model="MigrationData.StartTime" edit-input="false" show-icon="true" ng-model-options="{lang: 'en'}" ></input>

The issue is reproducable with
version 1.15.2
version 1.15.1

The behaviour doesn't change if I add the "timezone: 'utc'" attribute to ng-model-options.
My expectation of this option is, that the value in the field is UTC. But also with this option the value is local time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions