Skip to content

Releases: dromara/carbon

v2.6.14

28 Oct 13:46

Choose a tag to compare

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

15 Oct 06:42

Choose a tag to compare

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.goSetLocale 方法中使用 sync.Once 确保语言文件只加载一次,使用 sync.Map 进行线程安全的缓存
  • helper.goformat2layout 方法中为转义字符处理添加边界检查, 防止越界访问导致的 panic

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

v2.6.12

16 Sep 03:39

Choose a tag to compare

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

18 Jul 01:53

Choose a tag to compare

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

v2.6.10

07 Jul 03:34

Choose a tag to compare

English
  • Change Japanese translation file from jp.json to ja.json and rename document from README.jp.md to README.ja.md to comply with the ISO639-1 standard
  • Remove deprecated ParseWithLayouts method and replace with ParseByLayouts method
  • Remove deprecated ParseWithFormats method and replace with ParseByFormats method
  • Remove deprecated CleanTestNow method and replace with ClearTestNow method
  • Remove parsing support for timestamp strings from ParseByLayout and ParseByFormat methods, use CreateFromTimestamp, CreateFromTimestampMilli, CreateFromTimestampMicro, CreateFromTimestampNano to parse timestamp strings
  • Optimize getAbsValue method in helper.go to replace conditional judgments with bitwise operation
  • Optimize the methods related to time freezing in frozen.go, reduce lock contention using atomic operation and optimize memory allocation
  • Optimize benchmark test files to cover serial testing, parallel testing and concurrent testing
  • Add Korean readme document README.ko.md
  • Add Sleep method and related unit tests, benchmark tests, and example file
  • Add number constants such as MaxYear, MinYear, MaxMonth, MinMonth, MaxDay, MinDay etc. and replace hard coded with these constants
中文
  • 日语翻译文件从 jp.json 改成 ja.json,说明文档从 README.jp.md 更名为 README.ja.md,以符合 ISO639-1 标准
  • 移除已弃用的 ParseWithLayouts 方法,用 ParseByLayouts 方法替代
  • 移除已弃用的 ParseWithFormats 方法,用 ParseByFormats 方法替代
  • 移除已弃用的 CleanTestNow 方法,用 ClearTestNow 方法替代
  • 移除 ParseByLayoutParseByFormat 方法对时间戳字符串的解析支持,解析时间戳请使用 CreateFromTimestamp, CreateFromTimestampMilli, CreateFromTimestampMicro, CreateFromTimestampNano 方法
  • 优化 helper.gogetAbsValue 方法,用位操作替换条件判断
  • 优化 frozen.go 文件里时间冻结相关方法,用原子操作减少锁竞争,优化内存分配
  • 优化基准测试文件,覆盖串行测试并行测试并发测试
  • 新增韩语文档 README.ko.md
  • 新增 Sleep 方法及相关单元测试基准测试示例文件
  • 新增数字常量,如 MaxYear, MinYear, MaxMonth, MinMonth, MaxDay, MinDay 等,并使用这些常量替换硬编码

Full Changelog: v2.6.9...v2.6.10

v2.5.12

01 Jul 09:27

Choose a tag to compare

English
  • Remove the implementation of the GormDataType interface for gorm
  • Parsing when layouts or formats is empty, returns a error
  • Rename DateTimeType to dateTimeType, DateTimeXXXType to dateTimeXXXType in type_builtin.go
  • Rename DateType to dateType, DateXXXType to dateXXXType in type_builtin.go
  • Rename TimeType to timeType, TimeXXXType to timeXXXType in type_builtin.go
  • Simplify readme file and migrate overview and example usage to the official doc website
  • Add HelloGitHub badge link
中文
  • 移除对 gormGormDataType 接口的实现
  • 解析时如果布局模板或格式模板为空时,返回错误
  • type_builtin.go 中将 DateTimeType 重命名为dateTimeType,将 DateTimeXXXType 重命名为 dateTimeXXXType
  • type_builtin.go 中将 DateType 重命名为dateType,将 DateXXXType 重命名为 dateXXXType
  • type_builtin.go 中将 TimeType 重命名为timeType,将 TimeXXXType 重命名为 timeXXXType
  • 简化 READEME 文件,将详细使用说明和示例用法迁移到 官方网站
  • 添加 HelloGitHub 徽章链接

Full Changelog: v2.5.11...v2.5.12

v2.6.9

28 Jun 07:15

Choose a tag to compare

English
  • Remove the implementation of the GormDataType interface for gorm
中文
  • 移除对 gormGormDataType 接口的实现

Full Changelog: v2.6.8...v2.6.9

v2.6.8

12 Jun 04:14

Choose a tag to compare

English
  • Parsing when layouts or formats is empty, returns a error
  • Upgrade gorm.io/gorm from 1.21.1 to 1.30.0 in tests
  • Upgrade gorm.io/driver/mysql from 1.5.7 to 1.6.0 in tests
  • Upgrade gorm.io/driver/postgres from 1.5.7 to 1.6.0 in tests
  • Upgrade gorm.io/driver/sqlite from 1.5.7 to 1.6.0 in tests
  • Rename DateTimeType to dateTimeType, DateTimeXXXType to dateTimeXXXType in type_builtin.go
  • Rename DateType to dateType, DateXXXType to dateXXXType in type_builtin.go
  • Rename TimeType to timeType, TimeXXXType to timeXXXType in type_builtin.go
  • Simplify readme file and migrate overview and example usage to the official doc website
  • Add HelloGitHub badge link
中文
  • 解析时如果布局模板或格式模板为空时,返回错误
  • tests 中将 gorm.io/gorm1.21.1 升级到 1.30.0
  • tests 中将 gorm.io/driver/mysql1.5.7 升级到 1.6.0
  • tests 中将 gorm.io/driver/postgres1.5.7 升级到 1.6.0
  • tests 中将 gorm.io/driver/sqlite1.5.7 升级到 1.6.0
  • type_builtin.go 中将 DateTimeType 重命名为dateTimeType,将 DateTimeXXXType 重命名为 dateTimeXXXType
  • type_builtin.go 中将 DateType 重命名为dateType,将 DateXXXType 重命名为 dateXXXType
  • type_builtin.go 中将 TimeType 重命名为timeType,将 TimeXXXType 重命名为 timeXXXType
  • 简化 READEME 文件,将详细使用说明和示例用法迁移到 官方网站
  • 添加 HelloGitHub 徽章链接

Full Changelog: v2.6.7...v2.6.8

v2.6.7

26 May 02:37

Choose a tag to compare

English
  • String method removes the check for null value carbon
  • Rename type_interface.go file to interfaces.go
  • Change the second parameter of the Closest/Farthest methods to an optional parameter
  • Add ZeroValue/EpochValue methods
  • Add DataTyper interface, and enable builtin types to implement the DataTyper interface
中文
  • String 方法去掉对空值的检查
  • type_interface.go 更名为 interfaces.go
  • Closest/Farthest 方法第 2 个参数改成可选参数
  • 新增 ZeroValue/EpochValue 方法
  • 新增 DataTyper 接口和 DataType方法并让内置类型实现 DataTyper 接口

Full Changelog: v2.6.6...v2.6.7

v2.5.11

19 May 02:09

Choose a tag to compare

English
  • Fix bug locale file cannot be found on Windows os
  • Fix bug lose of values of layout, weekStartsAt, weekendDays and lang when create new Carbon instance #303
  • Fix bug StartOfWeek and EndOfWeek methods change original Carbon instance Unexpectedly #304
  • Add curd integration testing for xorm, currently covering MySQL/Postgres/SQLite
  • Add unit testing for the Windows os ci
中文
  • 修复在 window 平台无法找到语言文件的 bug
  • 修复在创建新的 Carbon 实例时丢失layoutweekStartsAtweekendDays 和 `lang 值的错误 #303
  • 修复 StartOfWeekEndOfWeek方法意外更改原始 Carbon实例的错误 #304
  • 新增对 xormcurd 集成测试,目前已覆盖 MySQL/Postgres/SQLite
  • 新增 window 系统的单元测试 ci