`Timex.from_now` unexpected result
まだ誰も着手していません。
評価
調査の方向性
まず、報告されている Timex 3.7.8 の再現手順を実行し、Timex.from_now のエントリポイントを追跡します。返される文言を、issue で期待されている暦日としての解釈と比較し、その後、両方の例に対するリグレッションテストを追加します。例が合意された結果を生成し、動作がテストによって文書化されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Steps to reproduce
timex 3.7.8
{:ok, dt, 0} = DateTime.from_iso8601("2022-07-30 17:06:27Z")
{DateTime.utc_now(), Timex.from_now(dt)}
# {~U[2022-08-01 08:20:03.093411Z], "yesterday"}
{:ok, dt, 0} = DateTime.from_iso8601("2022-07-29 17:17:39Z")
{DateTime.utc_now(), Timex.from_now(dt)}
# {~U[2022-08-01 08:21:43.460553Z], "2 days ago"}
Description of issue
- What are the expected results?
All of those results seem to be off by 1 day by my understanding.
Yesterday is the day before today, which from the perspective of 2022-08-01 is 2022-07-31, not 2022-07-30. Also in the same context I'd consider 2022-07-29 to be 3 days ago, though that one feels a bit more open to interpretation.
- If you are certain this is a bug in Timex, do you have references I
can use to check the algorithm/logic against? For instance, a well-established
date/time library in another language, a paper, test suite, etc. It is by no
means a requirement, but is immensely helpful in fixing bugs, and provides me
extra data to use when building out the test suite
- 主要言語
- Elixir
- スター
- 1.8k
- フォーク
- 408
- 平均マージ
- 2時間 8分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bitwalker/timex のほかの issue
-
4.0.0 is released!オープン
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
bitwalker/timex の issue をすべて見る
似ている issue
-
Heavy legs 1.12–1.17: compiler corpus goldens not regenerated for #4770対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
intellij-elixir/intellij-elixir#4782 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
hexlet-codebattle/codebattle#2376 ·
-
level 2 wocs
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
phravins/QuantumBilling#51 ·
-
fix(ocr): compile the Tesseract-free pipeline with Tokio runtime対応中かも @Goldziher が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
carverauto/serviceradar#6898 ·
メンテナーはふだん 1 日以内に返信