Frontend: Forecast dates/times in weather card incorrect in some browsers

Created on 20 Jan 2019  路  6Comments  路  Source: home-assistant/frontend

Home Assistant release with the issue:
0.85.1

Last working Home Assistant release (if known):
N/A

Browser and Operating System:
Inconsistency across browsers is the issue, but a minimal pair is Safari (or the iOS app which uses the same rendering backend) and Chrome/Chromium.

Description of problem:
As discussed in home-assistant/home-assistant#16548, on some browsers the forecast date/times in the weather card are displayed as doubly-offset from UTC, i.e. users in UTC-5 timezones see 5PM instead of 10PM while users in UTC-6 would see 4PM.

Javascript errors shown in the web inspector (if applicable):


Additional information:
Having determined that behavior varies between browsers, and having worked with JavaScript's implementation-depended date time handling, I suspected Date.parse() was being used somewhere. The culprit seems to be these one-off date formatting functions in ha-weather-card.js. Replacing them with proper calls to whatever home-assistant-polymer's standard date formatting functions are, which I believe pipe through the fecha library, will probably resolve the issue.

weather

Most helpful comment

@iantrich sorry this got lost in the deluge of GitHub notifications from work. I can probably take a look at it this weekend and submit a PR

All 6 comments

duplicate of https://github.com/home-assistant/home-assistant-polymer/issues/2249

@brlodi how do you feel about submitting a PR with a fix?

@iantrich sorry this got lost in the deluge of GitHub notifications from work. I can probably take a look at it this weekend and submit a PR

Has then been fixed?

Still seeing this issue in 0.89.1

This issue is closed for #2249 which is where any updates/questions should be made

Still seeing this issue in 0.92.2

Was this page helpful?
0 / 5 - 0 ratings

Related issues

casperklein picture casperklein  路  4Comments

Fusseldieb picture Fusseldieb  路  4Comments

Misiu picture Misiu  路  3Comments

move[bot] picture move[bot]  路  3Comments

Lopton picture Lopton  路  4Comments