Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

1.3.0 input[date] model is a Date object in local time zone instead of UTC #8447

Closed
@estekhin

Description

@estekhin

Please check this plunker for a demonstration.

Assuming the computer time zone is not UTC and the browser supports input[date], select a date from the input[date] dropdown.

The input field will display a date in the localized format, for example "01.08.2014" in my case. My current timezone is GMT+4.

value is

"2014-07-31T20:00:00.000Z"

but expected is either

"2014-07-31T20:00:00.000-0400"

or

"2014-08-01T00:00:00.000Z"

It seems that the code that converts input[date].value into a Date model object first obtains the correct value "2014-07-31T20:00:00.000-0400" but then replaces the correct "-0400" suffix with incorrect "Z", or it is a matter of formatting when the date is formatted as localized but the timezone is not part of the format and instead the "Z" suffix is hardcoded..

The code that converts the string value of the input[date] into a Date model should follow the HTML5 input[type=date] guidelines and convert the value string as if it is the start of the day in the UTC regardless of the current timezone.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions