Skip to content

Releases: dromara/carbon

v2.6.12

16 Sep 03:39
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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
Compare
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

v2.6.6

19 May 02:12
Compare
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 in ci action
中文
  • 修复在 window 平台无法找到语言文件的 bug
  • 修复在创建新的 Carbon 实例时丢失layoutweekStartsAtweekendDays 和 `lang 值的错误 #303
  • 修复 StartOfWeekEndOfWeek方法意外更改原始 Carbon实例的错误 #304
  • 新增对 xormcurd 集成测试,目前已覆盖 MySQL/Postgres/SQLite
  • ci 中新增 window 系统的单元测试

v2.6.5

14 May 09:28
Compare
Choose a tag to compare
English
  • Upgrade go version from 1.18 to 1.21
  • SetLanguage method of Carbon struct add check for invalid Language struct
  • Parse method of Carbon struct add support for Postgres/SQLite time format string
  • Parse/ParseByLayout/ParseByFormat methods of Carbon struct change the return value from nil to empty carbon when parsing an empty string
  • Carbon struct add IsEmpty method to determine if it is an empty carbon
  • Carbon struct add ClearTestNow method to replace CleanTestNow, CleanTestNow will be removed in the future
  • Carbon struct add ParseByLayouts method to replace ParseWithLayouts, ParseWithLayouts will be removed in the future
  • Carbon struct add ParseByFormats method to replace ParseWithFormats, ParseWithFormats will be removed in the future
  • Carbon struct remove GormDataType method and change Value/MarshalJSON methods from pointer receiver to value receiver
  • LayoutType[T] struct remove GormDataType method and change Value/MarshalJSON methods from pointer receiver to value receiver
  • FormatType[T] struct remove GormDataType method and change Value/MarshalJSON methods from pointer receiver to value receiver
  • TimestampType[T] struct remove GormDataType method and change Value/MarshalJSON methods from pointer receiver to value receiver
  • SetResources method of Language struct add check invalid resources
  • Add curd integration testing for gorm, currently covering MySQL/Postgres/SQLite
  • Replace github.com/stretchr/testify/assert with github.com/stretchr/testify/suite for unit testing
中文
  • Go 最低版本要求从 1.18 提升到 1.21
  • Carbon 结构体的 SetLanguage 方法增加对非法 Language 结构体的判断
  • Carbon 结构体的Parse 方法增加对 Postgres/SQLite 时间格式字符串的解析支持
  • Carbon 结构体的Parse/ParseByLayout/ParseByFormat方法解析 空字符串 时返回值从 nil 更改成空 carbon
  • Carbon 结构体新增 IsEmpty 方法用于判断是否为空 carbon
  • Carbon 结构体新增 ClearTestNow 方法替代 CleanTestNow, CleanTestNow 方法未来将移除
  • Carbon 结构体新增 ParseByLayouts 方法替代 ParseWithLayouts, ParseWithLayouts 方法未来将移除
  • Carbon 结构体新增 ParseByFormats 方法替代 ParseWithLayouts, ParseWithFormats 方法未来将移除
  • Carbon 结构体移除 GormDataType 方法, 并将 Value/MarshalJSON 方法从指针接收者改成接收者
  • LayoutType[T] 结构体移除 GormDataType 方法, 并将 Value/MarshalJSON 方法从指针接收者改成接收者
  • FormatType[T] 结构体移除 GormDataType 方法, 并将 Value/MarshalJSON 方法从指针接收者改成接收者
  • TimestampType[T] 结构体移除 GormDataType 方法, 并将 Value/MarshalJSON 方法从指针接收者改成接收者
  • Language 结构体的 SetResources 方法增加对非法资源的判断
  • 新增对 gormcurd 集成测试,目前已覆盖 MySQL/Postgres/SQLite
  • 使用 github.com/stretchr/testify/assert 替换 github.com/stretchr/testify/suite 进行单元测试