Skip to content

Releases

v2.7.1

Choose a tag to compare

@gouguoyin gouguoyin released this 06 Nov 07:27
2c7ac38

English

✨ Features

  • Add Bengali (bn) language support: adds localized month and weekday names, relative time expressions, seasons, and constellations (by @Goldloli in #390).

🐛 Fixes

  • Fix a panic when converting dates outside the supported lunar calendar range: dates outside 1900-01-31 through 2101-01-28 now produce an invalid Lunar value with an error instead of causing an index-out-of-range panic (by @ybai08 in #389).
  • Fix the start date of Sagittarius: IsSagittarius now starts on November 23, so November 22 is no longer classified as both Scorpio and Sagittarius (by @ChandraChaan in #391).
  • Fix the Persian name for Sunday: corrects the value returned by ToWeekString(FaLocale) (by @ChandraChaan in #392).
  • Fix AddDuration and SubDuration modifying the receiver on a parse error: the returned value carries the error while the original instance remains unchanged (by @simpleqt in #393).

🔧 Dependencies

中文

✨ 新功能

  • 新增孟加拉语(bn)支持:增加月份、星期、相对时间、季节和星座等本地化文本(by @Goldloli in #390)。

🐛 修复

  • 修复超出农历支持范围时发生 panic 的问题:公历日期超出 1900-01-31 至 2101-01-28 时,返回携带错误的无效 Lunar 值,避免数组越界(by @ybai08 in #389)。
  • 修复射手座起始日期错误的问题:IsSagittarius 从 11 月 23 日开始判定,避免将 11 月 22 日同时判定为天蝎座和射手座(by @ChandraChaan in #391)。
  • 修复波斯语星期日名称拼写错误的问题:更正 ToWeekString(FaLocale) 返回的星期日名称(by @ChandraChaan in #392)。
  • 修复 AddDuration 和 SubDuration 解析失败时修改原实例的问题:错误保留在返回值中,原实例保持不变(by @simpleqt in #393)。

🔧 依赖升级

  • 将 actions/checkout 从 v4 升级到 v7(by @dependabot[bot] in #385)。
  • 将 github/codeql-action 从 v4.38.3 升级到 v4.39.1(by @dependabot[bot] in #386 和 #388)。
  • 将 actions/setup-go 从 v5 升级到 v7(by @dependabot[bot] in #387)。
  • 将测试依赖 github.com/stretchr/testify 升级到 v1.12.1。

v2.7.0

Choose a tag to compare

@gouguoyin gouguoyin released this 19 Oct 05:22
93491ca

English

✨ Features

  • Add AddWeekdays, AddWeekday, SubWeekdays, SubWeekday methods to skip weekend days when counting working days: moves over days while skipping the weekend days configured on the instance, so deadlines can be counted in working days; the four names mirror AddDays / AddDay / SubDays / SubDay, and weekend days are read from the instance so SetWeekendDays keeps working; when all seven days are marked as weekend days, each weekday span is capped to a whole week to prevent infinite loops (by @darakanoit in #366)
  • Add IsSameWeek method to check whether two dates fall in the same week: completes the IsSame* family (IsSameCentury, IsSameDecade, IsSameYear, IsSameQuarter, IsSameWeek, IsSameMonth, IsSameDay, IsSameHour, IsSameMinute, IsSameSecond); honours SetWeekStartsAt so two dates that share a week under one setting may not share it under another; the comparison is based on the date the week starts on, correctly handling year-boundary-crossing weeks (by @darakanoit in #368)
  • Add IsBirthday method to compare month and day for birthdays: reports whether two dates fall on the same month and day, ignoring the year; without an argument it compares with now; February 29 only matches February 29, so it is never a birthday in a common year, matching PHP Carbon behaviour (by @darakanoit in #364)
  • Add Asia/Jakarta timezone constant support (by @mirzaq19 in #374)

🐛 Fixes

  • Fix StartOfSecond and EndOfSecond selecting the wrong occurrence during daylight-saving rollbacks: during a repeated daylight-saving hour, time.Date reconstruction could select the other occurrence of the same local time; now copies the instance and adjusts the existing timestamp's subsecond precision instead, preserving the selected instant, location and configuration (by @mikamikasuki in #377)
  • Fix StartOfMinute and EndOfMinute selecting the wrong occurrence during daylight-saving rollbacks: same bug as #377 one level up; now copies the instance and subtracts the local seconds, keeping the instant, location and offset (by @dualfroz in #378)
  • Fix StartOfHour and EndOfHour selecting the wrong occurrence during daylight-saving rollbacks: preserves the receiver's occurrence when the reconstructed hour boundary has a valid counterpart with the receiver's offset; keeps the existing calendar reconstruction when no such counterpart exists, including Lord Howe's partial-hour transitions (by @dajiaohuang in #382)
  • Fix DiffInSeconds ignoring the sub-second part and counting inaccurately across second boundaries: subtracting whole-second timestamps ignored the fractional part, so a gap of 0.2s across a second boundary counted as a full second; now adjusts by one when the nanosecond difference has the opposite sign, counting whole seconds elapsed and truncated toward zero (by @youdie006 in #379)
  • Fix DiffInDays and DiffInWeeks computing incorrect results across DST transitions: dividing elapsed seconds gave wrong results when crossing a DST change; now counts calendar days the way DiffInMonths counts months (AddDate plus an adjustment), and DiffInWeeks uses it; only intervals that cross a DST transition change (by @youdie006 in #376)
  • Fix DiffInYears and DiffInMonths producing incorrect estimates when comparing dates across different time zones: the first estimate from each date's own Year() / Month() fields could be off when the two dates are in different locations; now reads the later date in the earlier date's location before taking the year and month fields, matching the frame DiffInDays uses (by @ybai08 in #384)
  • Fix IsSameDecade not comparing the century: Decade() is the decade within the century, so Parse("1995-08-05").IsSameDecade(Parse("2095-08-05")) returned true; now also compares Century(), matching the buckets StartOfDecade uses (by @youdie006 in #375)
  • Fix FromStdTime returning the wrong lunar date just after midnight when the zone's UTC offset differs from 1900: elapsed time from 1900-01-31 in the time's own zone leaked the two instants' offsets into the day count; now counts the days between the wall-clock dates in UTC, matching persian.FromStdTime and hebrew.FromStdTime (by @youdie006 in #380)
  • Fix race condition in frozen-clock mode where concurrent Sleep calls lost clock advances: concurrent Sleep calls on a frozen clock raced with each other and with Now, losing clock advances; now uses the existing frozen-clock mutex around the check and update (by @yuefdev in #383)

🔧 Dependencies

中文

✨ 新功能

  • 新增 AddWeekdays、AddWeekday、SubWeekdays、SubWeekday 方法,支持跳过周末日进行工作日计算:按实例配置的周末日跳过非工作日进行日期推移,方便按工作日计算截止日期;四个方法命名与 AddDays / AddDay / SubDays / SubDay 保持一致,周末日从实例读取因此 SetWeekendDays 仍生效;当七天全部被标记为周末日时,每个工作日跨度被限制为整周以防止死循环(by @darakanoit in #366)
  • 新增 IsSameWeek 方法,判断两个日期是否在同一周:补全 IsSame* 家族(IsSameCentury、IsSameDecade、IsSameYear、IsSameQuarter、IsSameWeek、IsSameMonth、IsSameDay、IsSameHour、IsSameMinute、IsSameSecond);尊重 SetWeekStartsAt 设置,因此同一组日期在不同设置下可能不属于同一周;比较基于周起始日期,正确处理跨年份的边界周(by @darakanoit in #368)
  • 新增 IsBirthday 方法,比较月日判断是否生日:判断两个日期是否落在同一月同日,忽略年份;无参数时与当前时间比较;2月29日仅匹配2月29日,平年永远不会是生日,与 PHP Carbon 行为一致(by @darakanoit in #364)
  • 新增 Asia/Jakarta 时区常量支持(by @mirzaq19 in #374)

🐛 修复

  • 修复夏令时回退期间 StartOfSecond 和 EndOfSecond 方法选择错误时间出现的问题:在重复的夏令时小时内,time.Date 重建可能选择同一本地时间的另一次出现;现在改为复制实例并调整现有时间戳的亚秒精度,保留选中的时刻、位置和配置(by @mikamikasuki in #377)
  • 修复夏令时回退期间 StartOfMinute 和 EndOfMinute 方法选择错误时间出现的问题:与 #377 同一类 bug,只是上升了一级;现在复制实例并减去本地秒数,保留时刻、位置和偏移(by @dualfroz in #378)
  • 修复夏令时回退期间 StartOfHour 和 EndOfHour 方法选择错误时间出现的问题:当重建的小时边界存在与接收器偏移一致的有效对应出现时,保留接收器的出现;不存在对应出现时(如 Lord Howe 的部分小时间隔回退)保持现有日历重建行为(by @dajiaohuang in #382)
  • 修复 DiffInSeconds 方法忽略亚秒部分导致跨秒边界计时不准确的问题:减去整秒时间戳时忽略了小数部分,导致跨越秒边界的 0.2 秒间隙被计为整秒;现在当纳秒差符号相反时调整 ±1,按已流逝的整秒计数并朝零截断(by @youdie006 in #379)
  • 修复 DiffInDays 和 DiffInWeeks 方法跨越夏令时转换时计算错误的问题:除以流逝秒数在跨越夏令时转换时给出错误结果;现在改为按日历日计数(与 DiffInMonths 按月计数方式一致,AddDate 加调整),DiffInWeeks 基于它计算;仅跨越夏令时转换的区间结果会变化(by @youdie006 in #376)
  • 修复 DiffInYears 和 DiffInMonths 方法在不同时区之间比较时估算错误的问题:从各自日期的 Year() / Month() 字段进行首次估算时,两个日期处于不同位置可能导致偏差;现在先以较早日期所在位置读取较晚日期,再取年月字段,与 DiffInDays 使用的框架一致(by @ybai08 in #384)
  • 修复 IsSameDecade 方法未比较世纪导致跨世纪日期误判的问题:Decade() 是世纪内的十年,因此 Parse("1995-08-05").IsSameDecade(Parse("2095-08-05")) 曾返回 true;现在也比较 Century(),与 StartOfDecade 使用的分桶一致(by @youdie006 in #375)
  • 修复 FromStdTime 方法在凌晨时刻因 UTC 偏移差异返回错误农历日期的问题:以时间所在时区计算从 1900-01-31 起流逝的时间,两个时刻的偏移会泄漏到日计数中;现在改为在 UTC 中计算挂钟日期之间的天数,与 persian.FromStdTime 和 hebrew.FromStdTime 一致(by @youdie006 in #380)
  • 修复冻结时钟模式下并发调用 Sleep 方法导致时钟推进丢失的竞态问题:冻结时钟上的并发 Sleep 调用彼此以及与 Now 发生竞态,导致时钟推进丢失;现在使用现有的冻结时钟互斥锁包裹检查和更新(by @yuefdev in #383)

🔧 依赖升级

v2.6.18

Choose a tag to compare

@gouguoyin gouguoyin released this 28 Sep 13:22
d9a6370

English

✨ Features

  • Add Kazakh localised language support (lang/kk.json): month names, short month names, weekday names and short weekday names are taken verbatim from the Kazakh locale of PHP Carbon, which follows CLDR; relative time phrases follow Kazakh grammar where nouns do not inflect for number after a numeral; seasons and constellations are translated directly using traditional Kazakh names (by @darakanoit in #355)

🐛 Fixes

  • Fix possible out-of-bounds access when the Format method handles a trailing escape character: added boundary checks for escape character handling in format2layout method of helper.go to prevent panic caused by out-of-bounds access (by @gouguoyin in #348)
  • Fix incorrect weekday names returned by ToWeekString, ToShortWeekString, and Format when the week starts on a day other than Monday: ToWeekString / ToShortWeekString indexed the name resource by DayOfWeek() % DaysPerWeek, but the resources are ordered absolutely (Sunday first); now indexes by the absolute weekday int(StdTime().Weekday()), matching the resource order and mirroring what Format("l") already does (by @sneha4175 in #371)
  • Fix failure to clear the existing value when scanning NULL from a database into a field that already contains a time value: scanning a SQL NULL into an already populated Carbon value returned success but left the previous date in place; now resets the destination in Carbon.Scan and the layout, format, and timestamp scanner wrappers (by @vitalivo in #360)

⚡ Performance

  • Optimize language instance and resource caching and sharing through copy-on-write to reduce memory allocation: SetLocale copies the whole cached locale map into every Language instance, so every Carbon instance allocates a fresh 20-entry map; now SetLocale shares the cached map and marks it as shared, SetResources copies before its first write, and everything that only reads resources keeps reading the shared map; per NewCarbon(), allocation drops from 1600 B / 13 allocs to 232 B / 4 allocs (by @darakanoit in #350)
  • Optimize localized resource lookups for months, weekdays, seasons, and constellations to avoid splitting strings on every call: six methods read a "|" separated language resource and call strings.Split on every call just to index one element; now a small helper locates the item in place using strings.Count and strings.IndexByte, zero allocations per call; Constellation -61.54%, ToShortWeekString -47.35%, ToWeekString -44.13%, Season -40.65%, ToMonthString -37.66%, ToShortMonthString -35.88% (by @darakanoit in #352)
  • Share one language instance per locale: NewCarbon() built a fresh Language for every instance; now defaultLanguage(locale) caches one ready-to-use Language per locale in a sync.Map; constructing a Carbon goes from 4 allocations to 1 (by @darakanoit in #354)
  • Optimize lunar date conversion by precomputing tables for days per year and cumulative days: both lunar conversions walked the year table instead of indexing it, costing O(years since 1900); now derives the number of days in each supported year and the running total once at package initialisation; 2020 date to lunar 1009 ns -> 282 ns (-72%), back to gregorian 738 ns -> 23 ns (-97%) (by @darakanoit in #357)

🔧 Dependencies

🚀 CI

  • Improve the CI test workflow to run the full test suite and race detection on PRs, and generate and upload coverage only on push: test commands now target all packages via ./... instead of only the root package; coverage file generation and Codecov upload are gated to push events; added a dedicated test step using -race across all packages (by @gouguoyin in #361)

中文

✨ 新功能

  • 新增对 哈萨克语 的本地化语言支持(lang/kk.json):月份名称、短月份名称、星期名称和短星期名称取自 PHP Carbon 的哈萨克语本地化文件(遵循 CLDR);相对时间短语遵循哈萨克语语法,名词在数字后不变格;季节和星座使用传统哈萨克名称直译(by @darakanoit in #355)

🐛 修复

  • 修复 Format 方法处理末尾转义字符时可能发生越界访问的 bug:在 helper.go 的 format2layout 方法中为转义字符处理添加边界检查,防止越界访问导致的 panic(by @gouguoyin in #348)
  • 修复设置非周一为一周开始日期时,ToWeekString、ToShortWeekString 和 Format 方法返回星期名称错误的 bug:ToWeekString / ToShortWeekString 曾通过 DayOfWeek() % DaysPerWeek 索引名称资源,但资源按绝对顺序(周日优先)排列;现在改用 int(StdTime().Weekday()) 按绝对星期索引,与 Format("l") 行为一致(by @sneha4175 in #371)
  • 修复向已有时间值的数据库字段扫描 NULL 时未清空原值的 bug:向已包含时间值的 Carbon 扫描 SQL NULL 时返回成功但保留原日期;现在在 Carbon.Scan 及布局、格式和时间戳扫描器包装器中重置目标值(by @vitalivo in #360)

⚡ 性能优化

  • 优化语言实例和语言资源的缓存与共享机制,通过写时复制减少内存分配:SetLocale 此前将完整的缓存语言映射复制到每个 Language 实例,导致每个 Carbon 实例分配全新的 20 项映射;现在 SetLocale 共享缓存映射并标记为共享,SetResources 在首次写入前复制,只读资源的方法继续使用共享映射;每个 NewCarbon() 的分配从 1600 B / 13 次降至 232 B / 4 次(by @darakanoit in #350)
  • 优化月份、星期、季节和星座本地化资源查询,避免每次调用分割字符串:六个方法每次调用都读取 "|" 分隔的语言资源并使用 strings.Split 分割,仅为了索引一个元素;现在使用小型辅助函数通过 strings.Count 和 strings.IndexByte 原地定位元素,每次调用零分配;Constellation -61.54%,ToShortWeekString -47.35%,ToWeekString -44.13%,Season -40.65%,ToMonthString -37.66%,ToShortMonthString -35.88%(by @darakanoit in #352)
  • 每个 locale 共享一个语言实例:NewCarbon() 此前为每个实例构建全新的 Language;现在 defaultLanguage(locale) 在 sync.Map 中缓存每个 locale 一个即用型 Language;构造 Carbon 的分配从 4 次降至 1 次(by @darakanoit in #354)
  • 优化农历日期转换,预计算年度天数和累计天数表:农历转换此前遍历年份表而非索引,时间复杂度为 O(1900年以来的年数);现在在每个支持的年份和累计总数在包初始化时推导一次;2020 日期转农历 1009 ns -> 282 ns(-72%),转回公历 738 ns -> 23 ns(-97%)(by @darakanoit in #357)

🔧 依赖升级

🚀 CI

  • 完善 CI 测试流程,在 PR 上运行完整测试和竞态检测,并仅在 push 时生成和上传覆盖率:测试命令现在通过 ./... 覆盖所有包,而非仅根包;覆盖率文件生成和 Codecov 上传限制为 push 事件;新增使用 -race 的全包竞态检测步骤(by @gouguoyin in #361)

What's Changed

  • build(deps): bump github/codeql-action from 4.37.4 to 4.37.6 by @dependabot[bot] in #340
  • build(deps): bump github.com/stretchr/testify from 1.11.1 to 1.12.0 by @dependabot[bot] in #341
  • build(deps): bump github/codeql-action from 4.37.6 to 4.37.7 by @dependabot[bot] in #342
  • build(deps): bump github.com/stretchr/testify from 1.12.0 to 1.12.1 by @dependabot[bot] in #344
  • build(deps): bump github/codeql-action from 4.37.7 to 4.37.8 by @dependabot[bot] in #345
  • build(deps): bump github/codeql-action from 4.37.8 to 4.37.9 by @dependabot[bot] in #346
  • Fix possible out-of-bounds access when formatting time by @gouguoyin in #348
  • perf(language): Copy locale resources on write instead of on every SetLocale by @darakanoit in #350
  • perf(i18n): Look up language resources without splitting them on every call by @darakanoit in [#352](#3...
Read more

v2.6.17

Choose a tag to compare

@gouguoyin gouguoyin released this 09 Aug 16:42

Full Changelog: v2.6.16...v2.6.17

English

🐛 Fixes

  • Fix spelling error of the Friday name in the Indonesian locale (lang/id.json): the week-name resource spelled Friday as Jumaat; now changed to Jumat, the correct form in the official Indonesian dictionary (KBBI) (by @nmfzone in #329)
  • Fix systematically wrong conversion between the Gregorian calendar and the Hebrew calendar: calendar/hebrew returned wrong dates in both directions — NewHebrew(5784, 7, 1).ToGregorian() gave 2023-09-01 instead of 2023-09-16, and FromStdTime(2025-10-03) gave 5786-07-10 instead of 5786-07-11; the shared JDN conversion core reconstructed a Julian-calendar date (missing the Gregorian-reform correction, so modern dates came out ~13 days early), derived Rosh Hashanah from a routine that produced impossible year lengths, shortened Kislev in the wrong year type, and let jdn2hebrew advance the month a day early; it is now rebuilt on the standard Dershowitz–Reingold arithmetic over a single integer Julian-Day axis, matching the reference implementations on all 517,914 dates from 1583 to 3000 in both directions (by @binggao1230 in #338)

📄 Documentation

  • Migrate the four README files to a single NRG template: README.md, README.cn.md, README.ja.md and README.ko.md were maintained side by side, so every change meant editing the same paragraph in four places; they are now generated from one source of truth, README.src.md, whose lines are tagged with ``, and .github/workflows/nrg.yml regenerates and auto-commits on push to master while running a drift check on PRs; the generated files are byte-identical to the previous ones apart from a 2-line auto-generated header (by @andriishin in #331)
  • Remove the obsolete Go Report Card badge and clean up redundant advertising links in the README (by @gouguoyin in a65ddec)

🔧 Dependencies

🚀 CI

中文

🐛 修复

  • 修复 印度尼西亚语 本地化文件中星期五名称拼写错误的 bug(lang/id.json):星期名称资源曾将星期五拼写为 Jumaat;现已改为 Jumat,这是印尼语官方词典(KBBI)中的正确写法(by @nmfzone in #329)
  • 修复 公历 与 希伯来历 之间换算结果系统性错误的 bug:calendar/hebrew 双向换算均返回错误日期 —— NewHebrew(5784, 7, 1).ToGregorian() 返回 2023-09-01 而非 2023-09-16,FromStdTime(2025-10-03) 返回 5786-07-10 而非 5786-07-11;其共享的儒略日换算核心重建了儒略历日期(缺少格里高利历改历修正,导致现代日期提前约 13 天)、用会产生不可能年长(如 5785→5786 的 356 天)的算法推导岁首、在错误的年份类型上缩短基斯流月、并让 jdn2hebrew 提前一天进位月份;现在核心已按标准 Dershowitz–Reingold 算法重建于单一整数儒略日轴上,在 1583 至 3000 年间的全部 517,914 个日期上双向均与参考实现一致(by @binggao1230 in #338)

📄 文档

  • 将四个 README 文档迁移为单一的 NRG 模板:README.md、README.cn.md、README.ja.md 和 README.ko.md 此前是并列手工维护的,每次修改都要在四处编辑同一段落;现在统一由唯一数据源 README.src.md 生成,其每一行都用 `` 标记所属语言,.github/workflows/nrg.yml 在推送 master 时自动重新生成并提交,在 PR 上执行漂移检查;生成结果除 2 行自动生成的文件头外与原有文件完全一致(by @andriishin in #331)
  • 移除 README 中已废弃的 Go Report Card 状态徽章,并清理冗余广告外链(by @gouguoyin in a65ddec)

🔧 依赖升级

🚀 CI

What's Changed

v2.6.16

Choose a tag to compare

@gouguoyin gouguoyin released this 28 Jan 11:51
English
  • Fix the bug in the parsing of u, v, and x symbols in the Format method #328
  • Upgrade actions/checkout from v5 to v6
中文
  • 修复 Format 方法中u、v、x符号解析错误的 bug
  • 将 actions/checkout 从 v5 升级到 v6

Full Changelog: v2.6.15...v2.6.16

v2.6.15

Choose a tag to compare

@gouguoyin gouguoyin released this 15 Nov 10:17
English
  • Remove the Abs method used in the DiffAbsInDuration method of the difference.go file, which is only available since go1.19
  • Fix duplicate Zondag error in the weeks field of the Dutch localised language file(lang/nl.json)
  • Add HttpLayout, HttpFormat constants and ToHttpString method
  • Add Mongolian localised language support(lang/mn.json)
  • Add Afrikaans localised language support(lang/af.json)
中文
  • 移除 difference.go 文件的 DiffAbsInDuration 方法里使用的从 go1.19 才有的 Abs 方法
  • 修复 荷兰语 本地化语言文件(lang/nl.json)里 weeks 字段里重复的 Zondag 错误
  • 增加 HttpLayout, HttpFormat 常量以及 ToHttpString 方法
  • 增加对 蒙古语 的本地化语言支持(lang/mn.json)
  • 增加对 南非语 的本地化语言支持(lang/af.json)

Full Changelog: v2.6.14...v2.6.15

v2.6.14

Choose a tag to compare

@gouguoyin gouguoyin released this 28 Oct 13:46
English
  • Refactor time addition and subtraction series methods in traveler.go file to ensure immutability by copying instances to avoid modifying the original instance
  • Add Greek localised language support
  • Add Finnish localised language support
  • Add Myanmar localised language support
中文
  • 重构 traveler.go 文件里时间增减系列方法通过复制实例来保证不可变性,以避免修改原始实例
  • 增加对 希腊语 的本地化语言支持
  • 增加对 芬兰语 的本地化语言支持
  • 增加对 缅甸语 的本地化语言支持

Full Changelog: v2.6.13...v2.6.14

v2.6.13

Choose a tag to compare

@gouguoyin gouguoyin released this 15 Oct 06:42
English
  • Use sync.Once in SetLocale method of language.go to ensure language files are loaded only once, and use sync.Map for thread-safe caching #319
  • Add boundary checks for escape character handling in format2layout method of helper.go to prevent panic caused by out-of-bounds access
中文
  • 在 language.go 的 SetLocale 方法中使用 sync.Once 确保语言文件只加载一次,使用 sync.Map 进行线程安全的缓存
  • 在 helper.go 的 format2layout 方法中为转义字符处理添加边界检查, 防止越界访问导致的 panic

Full Changelog: v2.6.12...v2.6.13

v2.6.12

Choose a tag to compare

@gouguoyin gouguoyin released this 16 Sep 03:39
English
  • Lower golang environment dependency from 1.21 to 1.18
  • Upgrade testify testing framework from v1.10.0 to v1.11.1
  • Set isEmpty flag in UnmarshalJSON method of type_carbon.go file to indicate empty values
  • Use sync.Map to implement high-performance concurrent caching
  • Fix potential race conditions and null pointer dereference issues, improving concurrency safety
中文
  • 将 golang 环境依赖从 1.21 降低到 1.18
  • 将 testify 测试框架从 v1.10.0 升级到 v1.11.1
  • 在 type_carbon.go 文件 UnmarshalJSON 方法中设置 isEmpty 标志以表示空值
  • 使用 sync.Map 实现高性能并发缓存
  • 修复潜在的竞态条件和空指针解引用问题,提高并发安全性

Full Changelog: v2.6.11...v2.6.12

v2.6.11

Choose a tag to compare

@gouguoyin gouguoyin released this 18 Jul 01:53
English
  • Change Sleep from struct method to global method
  • Refactor Persian calendar and add benchmark test files
  • Refactor Chinese Lunar calendar and add benchmark test files
  • Refactor Julian/Modified Julian calendar and add benchmark test files
  • Add Hebrew calendar support and add unit tests and benchmark test files
  • Add overall performance test report file
中文
  • 将 Sleep 由结构体方法更改成全局方法
  • 重构 波斯历 并添加基准测试文件
  • 重构 中国农历 并添加基准测试文件
  • 重构 儒略日/简化儒略日 并添加基准测试文件
  • 新增 希伯来历 支持并添加单元测试和基准测试文件
  • 新增整体性能测试报告文件

Full Changelog: v2.6.10...v2.6.11

⌂ 换网址