Habits & Summaries: Timezone bug?
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
調査の方向性
Habit & Summary Charts の軸の目盛りラベルの処理経路を確認します。特に、YYYY-MM-DD の値が Date オブジェクトになる箇所を重点的に確認してください。issue では、これが有力なエントリーポイントとして特定されています。America/Denver で last-2-weeks 期間を使って再現し、ラベルをツールチップと比較してください。軸ラベルが期間およびツールチップの日付と一致し、基になるデータを変更していなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Checks
- I confirm I have restarted NotePlan and this problem still persists.
- I confirm I have reinstalled the Plugin and this problem still persists.
- Is this a repeatable problem?
System
- Device OS: macOS Version 27.0 (26A428), iOS 27.0 (24A437)
- NotePlan Version: Version 3.21.3 (1534)
- Plugin Name & Version: "Habit & Summary Charts" v1.2.0
- Timezone: America/Denver (MDT, UTC-6)
Describe the bug
Chart x-axis labels are one day earlier than the dates of the data plotted above them. Tooltips show the correct date, so the data appears to be keyed correctly and only the axis tick labels are shifted.
With Period set to "last 2 weeks" (header: 2026-09-14 - 2026-09-27), the x-axis runs Sep 13 - Sep 26.
Examples from the same view:
- @bike logged Sep 24 (16.4) and Sep 25 (30.8). The bars appear above the labels "Sep 23" and "Sep 24". Hovering them shows tooltips "Thu, 24 Sep 2026" and "Fri, 25 Sep 2026".
- @run logged Sep 15 (4.1). The bar appears above the label "Sep 14".
- Sep 13's daily note has @bike, @run and @swim entries. The chart has a "Sep 13" label with nothing above it, because that slot is really Sep 14 (Sep 13 is correctly outside the period).
Happens on both macOS and iOS.
Likely cause: the tick labels look like they're built from new Date('YYYY-MM-DD'), which JavaScript parses as UTC midnight, then formatted in local time. West of UTC, midnight UTC on Sep 14 displays as Sep 13. The tooltip seems to use a different path that gets it right. Constructing local dates for the ticks should fix it, e.g. new Date(y, m - 1, d), new Date(str + 'T00:00:00'), or moment(str, 'YYYY-MM-DD'). This wouldn't show up for anyone at UTC or east of it.
What do you expect it to do instead?
Axis labels should match the period (Sep 14 - Sep 27) and the tooltip date for each bar.
To Reproduce
- Set system timezone to one west of UTC (e.g. America/Denver)
- Log a value (e.g. @run(4.1)) in a daily note
- Open Habit & Summary Charts and choose a period containing that day
- Compare the axis label under the bar with the date in its tooltip
- See the axis label is one day earlier
Screenshots
- 主要言語
- JavaScript
- スター
- 204
- フォーク
- 83
- 平均マージ
- 22時間 27分
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NotePlan/plugins のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
Tidy: Issue with plugin.json再び着手できるかも @jgclark が 60 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
NotePlan/plugins の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
solana-foundation/solana-com#2202 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
yegor256/copyrights-action#216 ·
-
[BUG] onScroll never refreshes the window container's height after a vertical-only viewport resizeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
juliangarnier/anime#1192 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
PedestrianDynamics/pyFDS-Evac#226 ·
メンテナーはふだん 1 日以内に返信