Skip to content

v2.7.2

Latest

Choose a tag to compare

@gouguoyin gouguoyin released this 26 Nov 11:47
25484a2

English

🚀 Performance

  • Optimize Format for common format symbols: reduce temporary string allocations while preserving the existing output (by @g4lb in #394).

🐛 Fixes

  • Fix Persian calendar leap-year calculation: use the 33-year leap-year rule for supported years, correcting date conversion and leap-day validation (by @jayhemnani9910 in #395).
  • Reject invalid lunar dates: validate the month, day, and leap month in lunar.NewLunar and carbon.CreateFromLunar instead of converting nonexistent dates (by @Kernel-Hunter in #397).
  • Fix Format("l") ignoring the locale: the full weekday name now follows the configured locale, consistent with ToWeekString() (by @shounakjoshi88-a11y in #398).
  • Fix date boundaries around midnight clock changes: keep day, week, month, quarter, year, and season boundaries on the correct local dates when clocks change at midnight (by @bardrop in #401).
  • Fix error wrapping on Go 1.18 and 1.19: preserve the underlying cause and avoid invalid error formatting when parsing or setting a locale (by @bardrop in #402).
  • Correct lunar calendar data for 1954, 1956, 1978, 2033, and 2060: fix affected lunar and Gregorian date conversions, including the leap month in 2033 (by @bardrop in #404).
  • Fix lunar festivals being reported in leap months: Lunar.Festival() now reports festivals only in the regular month (by @bardrop in #405).
  • Fix interval comparisons with invalid bounds: BetweenIncludedStart, BetweenIncludedEnd, and BetweenIncludedBoth now validate their inputs before handling zero-time values (by @anishpentyala in #406).
  • Fix subsecond precision in Closest and Farthest: compare distances using seconds and nanoseconds so that distinct fractional-second distances are ordered correctly (by @anishpentyala in #407).
  • Fix the Ukrainian word for one week: replace a Latin character with the correct Cyrillic character in the localized text (by @bardrop in #409).
  • Fix Polish translations: correct plural forms for counts of 3 and 4, the expression for future relative time, and the name of spring (by @mansur-akhmadi in #411).

📝 Documentation

  • Correct the README examples: fix the DiffForHumans output and the GitCode import path (by @Kernel-Hunter in #399).
  • Update the benchmark reports: rewrite the reports using actual test results.

🔧 Dependencies

中文

🚀 性能优化

  • 优化 Format 常用格式符的处理:减少临时字符串分配,同时保持现有输出不变(by @g4lb in #394)。

🐛 修复

  • 修复波斯历闰年计算错误:对支持的年份采用 33 年闰年规则,修正日期转换和闰日校验(by @jayhemnani9910 in #395)。
  • 修复无效农历日期被接受的问题:lunar.NewLunar 和 carbon.CreateFromLunar 现在会校验月份、日期和闰月,避免将不存在的农历日期转换为公历日期(by @Kernel-Hunter in #397)。
  • 修复 Format("l") 忽略语言设置的问题:完整星期名称现在会遵循当前语言设置,与 ToWeekString() 保持一致(by @shounakjoshi88-a11y in #398)。
  • 修复午夜时钟调整导致日期边界错误的问题:在时区于午夜调整时钟时,确保日、周、月、季度、年和季节边界位于正确的本地日期(by @bardrop in #401)。
  • 修复 Go 1.18 和 1.19 下的错误包装问题:在解析或设置语言时保留底层错误原因,避免错误信息格式异常(by @bardrop in #402)。
  • 修复 1954、1956、1978、2033 和 2060 年的农历数据:修正受影响的农历与公历日期转换,包括 2033 年的闰月(by @bardrop in #404)。
  • 修复闰月重复显示农历节日的问题:Lunar.Festival() 现在仅在普通月份返回对应节日(by @bardrop in #405)。
  • 修复区间边界无效时比较结果错误的问题:BetweenIncludedStart、BetweenIncludedEnd 和 BetweenIncludedBoth 现在会在处理零时间之前校验输入(by @anishpentyala in #406)。
  • 修复 Closest 和 Farthest 的亚秒精度问题:使用秒和纳秒比较时间距离,正确区分不足一秒的距离差异(by @anishpentyala in #407)。
  • 修复乌克兰语中“一周”的拼写:将本地化文本中的拉丁字母替换为正确的西里尔字母(by @bardrop in #409)。
  • 修复波兰语翻译:更正数量为 3 和 4 时的复数形式、未来相对时间表达和春季名称(by @mansur-akhmadi in #411)。

📝 文档

  • 修正 README 示例:更正 DiffForHumans 的输出和 GitCode 导入路径(by @Kernel-Hunter in #399)。
  • 更新性能测试报告:根据实际测试结果重写性能报告。

🔧 依赖升级