Shapes and annotations do not handle Date objects or strings with time zones
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 18.3k
- フォーク
- 2k
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 28
説明
At the moment (version 1.25.1), data traces can handle Date objects, which will then be displayed with what seems to be the browser's timezone settings. For example, date = new Date("2017-03-30T00:00:00.000Z") used on the X-axis in a trace, with a browser in the UTC+1 timezone will be displayed as "Mar 30, 2017, 01:00", which is indeed correct.
However, that same date object cannot be used for x0/x1 in a shape on the same object.
When using date.toISOString() instead (both for data and shapes), the timezone indicator (e.g. Z) at the end of the string is ignored and the string is considered to be within the local time zone.
Here is a jsfiddle to demonstrate the problem: https://jsfiddle.net/tkhmx8Le/

Effectively, the problem is two-fold (and might lead to two separate issues):
- It would be good if
shapesandannotationsalso supported date objects. - ISO-8601 date parsing should take into account the
Z(or generally+xxxxor+xx:xx) timezone indicator before building its internal UTC representation. This is certainly related to #1003 (and subsequent work).
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされた JSFiddle でタイムゾーンの不一致を再現することから始め、data traces、shapes、annotations 内の Date オブジェクトと ISO-8601 文字列を比較します。#1003 の関連する作業を読み、既存の日付解析パスを追跡します。shapes と annotations が Date オブジェクトを受け入れ、タイムゾーンインジケーターが一貫して尊重されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 50/100