Timex.format seems off at the end of the month
还没有人认领这个 Issue。
评估
调研方向
首先使用 "{relative}" formatter 和 :relative 选项重现报告中的 Timex.shift 和 Timex.format! 调用,然后检查 relative formatting 的入口点。比较接近月份边界时以及增加一小时后的结果。当示例报告出预期的月份数,并且回归覆盖证明行为已得到修正时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Steps to reproduce
iex> in_5_months = Timex.shift(Timex.now(), months: 5)
~U[2023-06-30 07:51:27.003055Z]
iex> Timex.format!(in_5_months, "{relative}", :relative)
"in 4 months"
Description of issue
- Timex.format seems to miss a month - the result should be "in 5 months", instead of "in 4 months". The output of Timex.shift looks good.
- It seems the error is only occuring starting recently, it was fine before.
- At first I thought it was because due to me testing on the 31st. But apparently the issue is not related to the date. I guess it depends if Timex.format does some rounding? Otherwise 5 months - a few secons is already 4 months. It works fine if I add another hour. I'm just curious why it worked before.
Could this be related to this issue? https://github.com/bitwalker/timex/issues/535
I hope I didn't miss any other open issue related to this. Thank you for the great work!
- 主要语言
- Elixir
- 星标
- 1.8k
- 派生
- 408
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bitwalker/timex 的其他 Issue
-
难度 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
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 69/100
ash-project/ash_typescript#114 ·
-
Unused require Logger warning in lib/absinthe/plug.ex (Elixir 1.20)可能已有人在做 @obutuz 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 68/100
whatyouhide/redix#358 ·
-
Single broadcast API sends private=True messages to the public topic可能已有人在做 @hsusul 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
component:obi contribfest go test
难度 2/5 1 小时以内 新手友好度 77/100
open-telemetry/opentelemetry-ebpf-instrumentation#4142 · 1 条评论 ·
维护者通常 1 天内回复