Releases: dromara/carbon
Releases · dromara/carbon
v2.6.14
English
- Refactor time addition and subtraction series methods in
traveler.gofile to ensure immutability by copying instances to avoid modifying the original instance - Add
Greeklocalised language support - Add
Finnishlocalised language support - Add
Myanmarlocalised language support
中文
- 重构
traveler.go文件里时间增减系列方法通过复制实例来保证不可变性,以避免修改原始实例 - 增加对
希腊语的本地化语言支持 - 增加对
芬兰语的本地化语言支持 - 增加对
缅甸语的本地化语言支持
Full Changelog: v2.6.13...v2.6.14
v2.6.13
English
- Use
sync.OnceinSetLocalemethod oflanguage.goto ensure language files are loaded only once, and usesync.Mapfor thread-safe caching #319 - Add boundary checks for escape character handling in
format2layoutmethod ofhelper.goto preventpaniccaused 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
English
- Lower
golangenvironment dependency from1.21to1.18 - Upgrade
testifytesting framework fromv1.10.0tov1.11.1 - Set
isEmptyflag inUnmarshalJSONmethod oftype_carbon.gofile to indicate empty values - Use
sync.Mapto 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
English
- Change
Sleepfrom struct method to global method - Refactor
Persiancalendar and add benchmark test files - Refactor
Chinese Lunarcalendar and add benchmark test files - Refactor
Julian/Modified Juliancalendar and add benchmark test files - Add
Hebrewcalendar 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
English
- Change
Japanesetranslation file fromjp.jsontoja.jsonand rename document fromREADME.jp.mdtoREADME.ja.mdto comply with the ISO639-1 standard - Remove deprecated
ParseWithLayoutsmethod and replace withParseByLayoutsmethod - Remove deprecated
ParseWithFormatsmethod and replace withParseByFormatsmethod - Remove deprecated
CleanTestNowmethod and replace withClearTestNowmethod - Remove parsing support for timestamp strings from
ParseByLayoutandParseByFormatmethods, useCreateFromTimestamp,CreateFromTimestampMilli,CreateFromTimestampMicro,CreateFromTimestampNanoto parse timestamp strings - Optimize
getAbsValuemethod inhelper.goto replace conditional judgments withbitwise operation - Optimize the methods related to time freezing in
frozen.go, reduce lock contention usingatomic operationand optimize memory allocation - Optimize benchmark test files to cover
serialtesting,paralleltesting andconcurrenttesting - Add Korean readme document
README.ko.md - Add
Sleepmethod and relatedunit tests,benchmark tests, andexample file - Add number constants such as
MaxYear,MinYear,MaxMonth,MinMonth,MaxDay,MinDayetc. 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方法替代 - 移除
ParseByLayout和ParseByFormat方法对时间戳字符串的解析支持,解析时间戳请使用CreateFromTimestamp,CreateFromTimestampMilli,CreateFromTimestampMicro,CreateFromTimestampNano方法 - 优化
helper.go里getAbsValue方法,用位操作替换条件判断 - 优化
frozen.go文件里时间冻结相关方法,用原子操作减少锁竞争,优化内存分配 - 优化基准测试文件,覆盖
串行测试、并行测试和并发测试 - 新增韩语文档
README.ko.md - 新增
Sleep方法及相关单元测试、基准测试和示例文件 - 新增数字常量,如
MaxYear,MinYear,MaxMonth,MinMonth,MaxDay,MinDay等,并使用这些常量替换硬编码
Full Changelog: v2.6.9...v2.6.10
v2.5.12
English
- Remove the implementation of the
GormDataTypeinterface forgorm - Parsing when layouts or formats is empty, returns a error
- Rename
DateTimeTypetodateTimeType,DateTimeXXXTypetodateTimeXXXTypeintype_builtin.go - Rename
DateTypetodateType,DateXXXTypetodateXXXTypeintype_builtin.go - Rename
TimeTypetotimeType,TimeXXXTypetotimeXXXTypeintype_builtin.go - Simplify readme file and migrate overview and example usage to the official doc website
- Add HelloGitHub badge link
中文
- 移除对
gorm的GormDataType接口的实现 - 解析时如果布局模板或格式模板为空时,返回错误
- 在
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
English
- Remove the implementation of the
GormDataTypeinterface forgorm
中文
- 移除对
gorm的GormDataType接口的实现
Full Changelog: v2.6.8...v2.6.9
v2.6.8
English
- Parsing when layouts or formats is empty, returns a error
- Upgrade
gorm.io/gormfrom1.21.1to1.30.0intests - Upgrade
gorm.io/driver/mysqlfrom1.5.7to1.6.0intests - Upgrade
gorm.io/driver/postgresfrom1.5.7to1.6.0intests - Upgrade
gorm.io/driver/sqlitefrom1.5.7to1.6.0intests - Rename
DateTimeTypetodateTimeType,DateTimeXXXTypetodateTimeXXXTypeintype_builtin.go - Rename
DateTypetodateType,DateXXXTypetodateXXXTypeintype_builtin.go - Rename
TimeTypetotimeType,TimeXXXTypetotimeXXXTypeintype_builtin.go - Simplify readme file and migrate overview and example usage to the official doc website
- Add HelloGitHub badge link
中文
- 解析时如果布局模板或格式模板为空时,返回错误
- 在
tests中将gorm.io/gorm从1.21.1升级到1.30.0 - 在
tests中将gorm.io/driver/mysql从1.5.7升级到1.6.0 - 在
tests中将gorm.io/driver/postgres从1.5.7升级到1.6.0 - 在
tests中将gorm.io/driver/sqlite从1.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
English
Stringmethod removes the check for null value carbon- Rename
type_interface.gofile tointerfaces.go - Change the second parameter of the
Closest/Farthestmethods to an optional parameter - Add
ZeroValue/EpochValuemethods - Add
DataTyperinterface, and enable builtin types to implement theDataTyperinterface
中文
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
English
- Fix bug locale file cannot be found on
Windowsos - Fix bug lose of values of
layout,weekStartsAt,weekendDaysandlangwhen create newCarboninstance #303 - Fix bug
StartOfWeekandEndOfWeekmethods change originalCarboninstance Unexpectedly #304 - Add
curdintegration testing forxorm, currently coveringMySQL/Postgres/SQLite - Add unit testing for the
Windowsosci