Releases: dromara/carbon
Releases · dromara/carbon
v2.6.12
English
- Lower
golang
environment dependency from1.21
to1.18
- Upgrade
testify
testing framework fromv1.10.0
tov1.11.1
- Set
isEmpty
flag inUnmarshalJSON
method oftype_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
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
English
- Change
Japanese
translation file fromjp.json
toja.json
and rename document fromREADME.jp.md
toREADME.ja.md
to comply with the ISO639-1 standard - Remove deprecated
ParseWithLayouts
method and replace withParseByLayouts
method - Remove deprecated
ParseWithFormats
method and replace withParseByFormats
method - Remove deprecated
CleanTestNow
method and replace withClearTestNow
method - Remove parsing support for timestamp strings from
ParseByLayout
andParseByFormat
methods, useCreateFromTimestamp
,CreateFromTimestampMilli
,CreateFromTimestampMicro
,CreateFromTimestampNano
to parse timestamp strings - Optimize
getAbsValue
method inhelper.go
to replace conditional judgments withbitwise operation
- Optimize the methods related to time freezing in
frozen.go
, reduce lock contention usingatomic operation
and optimize memory allocation - Optimize benchmark test files to cover
serial
testing,parallel
testing andconcurrent
testing - Add Korean readme document
README.ko.md
- Add
Sleep
method and relatedunit tests
,benchmark tests
, andexample 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
方法替代 - 移除
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
GormDataType
interface forgorm
- Parsing when layouts or formats is empty, returns a error
- Rename
DateTimeType
todateTimeType
,DateTimeXXXType
todateTimeXXXType
intype_builtin.go
- Rename
DateType
todateType
,DateXXXType
todateXXXType
intype_builtin.go
- Rename
TimeType
totimeType
,TimeXXXType
totimeXXXType
intype_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
GormDataType
interface 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/gorm
from1.21.1
to1.30.0
intests
- Upgrade
gorm.io/driver/mysql
from1.5.7
to1.6.0
intests
- Upgrade
gorm.io/driver/postgres
from1.5.7
to1.6.0
intests
- Upgrade
gorm.io/driver/sqlite
from1.5.7
to1.6.0
intests
- Rename
DateTimeType
todateTimeType
,DateTimeXXXType
todateTimeXXXType
intype_builtin.go
- Rename
DateType
todateType
,DateXXXType
todateXXXType
intype_builtin.go
- Rename
TimeType
totimeType
,TimeXXXType
totimeXXXType
intype_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
String
method removes the check for null value carbon- Rename
type_interface.go
file tointerfaces.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 theDataTyper
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
English
- Fix bug locale file cannot be found on
Windows
os - Fix bug lose of values of
layout
,weekStartsAt
,weekendDays
andlang
when create newCarbon
instance #303 - Fix bug
StartOfWeek
andEndOfWeek
methods change originalCarbon
instance Unexpectedly #304 - Add
curd
integration testing forxorm
, currently coveringMySQL
/Postgres
/SQLite
- Add unit testing for the
Windows
osci
中文
v2.6.6
English
- Fix bug locale file cannot be found on
Windows
os - Fix bug lose of values of
layout
,weekStartsAt
,weekendDays
andlang
when create newCarbon
instance #303 - Fix bug
StartOfWeek
andEndOfWeek
methods change originalCarbon
instance Unexpectedly #304 - Add
curd
integration testing forxorm
, currently coveringMySQL
/Postgres
/SQLite
- Add unit testing for the
Windows
os inci
action
中文
v2.6.5
English
- Upgrade
go
version from1.18
to1.21
SetLanguage
method ofCarbon
struct add check for invalidLanguage
structParse
method ofCarbon
struct add support forPostgres
/SQLite
time format stringParse
/ParseByLayout
/ParseByFormat
methods ofCarbon
struct change the return value fromnil
toempty
carbon when parsing anempty
stringCarbon
struct addIsEmpty
method to determine if it is anempty
carbonCarbon
struct addClearTestNow
method to replaceCleanTestNow
,CleanTestNow
will be removed in the futureCarbon
struct addParseByLayouts
method to replaceParseWithLayouts
,ParseWithLayouts
will be removed in the futureCarbon
struct addParseByFormats
method to replaceParseWithFormats
,ParseWithFormats
will be removed in the futureCarbon
struct removeGormDataType
method and changeValue
/MarshalJSON
methods frompointer
receiver tovalue
receiverLayoutType[T]
struct removeGormDataType
method and changeValue
/MarshalJSON
methods frompointer
receiver tovalue
receiverFormatType[T]
struct removeGormDataType
method and changeValue
/MarshalJSON
methods frompointer
receiver tovalue
receiverTimestampType[T]
struct removeGormDataType
method and changeValue
/MarshalJSON
methods frompointer
receiver tovalue
receiverSetResources
method ofLanguage
struct add check invalid resources- Add
curd
integration testing forgorm
, currently coveringMySQL
/Postgres
/SQLite
- Replace
github.com/stretchr/testify/assert
withgithub.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
方法增加对非法资源的判断- 新增对
gorm
的curd
集成测试,目前已覆盖MySQL
/Postgres
/SQLite
- 使用
github.com/stretchr/testify/assert
替换github.com/stretchr/testify/suite
进行单元测试