Skip to content

Releases: dromara/carbon

v2.5.2

03 Dec 02:40
Compare
Choose a tag to compare

What's Changed

  • Fix Time, TimeMilli, TimeMicro, TimeNano type fields cannot be parsed when unmarshalJSON
  • Remove deprecated method ToStdTime
  • Add MaxValue, MinValue, IsValid methods for Gregorian calendar
  • Add MaxValue, MinValue, IsValid methods for Lunar calendar
  • Add MaxValue, MinValue, ToShortMonthString, ToShortWeekString methods for Persian calendar
  • Add optional parameter local, optional value en/fa for Persian calendar ToMonthString, ToWeekString methods, default is en

Full Changelog: v2.5.1...v2.5.2

v2.5.1

29 Nov 07:55
Compare
Choose a tag to compare

What's Changed

  • Add MaxValue,MinValue methods
  • Add reference url
  • Optimize IsValid method base MinValue, MinValue
  • Time, TimeMilli, TimeMicro, TimeNano structs set year, month, day when UnmarshalJSON
  • Fix minor grammar and notation corrections by @You-saku in #260
  • Bump github.com/stretchr/testify from 1.9.0 to 1.10.0 by @dependabot in #261

Full Changelog: v2.5.0...v2.5.1

v2.5.0

25 Nov 09:30
Compare
Choose a tag to compare

What's Changed

  • Change repository url from github.com/golang-module/carbon to github.com/dromara/carbon
  • Add hungarian translation #39 by @kenlas in #252
  • Add support for string and []byte types when parsing database data in Scan method #251
  • Retranslate README.jp by @You-saku in #259
  • Fix DiffInMonths() method bug #255
  • Fix Japanese translation by @nkmr-jp in #254
  • Replace Lock() with RLock(),Unlock() with RUnlock() to optimize performance by @ritbrz in #253
  • Replace ToDateTimeStruct() with NewDateTime(),ToDateTimeMilliStruct() with NewDateTimeMilli(),ToDateTimeMicroStruct() with NewDateTimeMicro(),ToDateTimeMilliNanoStruct() with NewDateTimeNano()
  • Replace ToDateStruct() with NewDate(),ToDateMilliStruct() with NewDateMilli(),ToDateMicroStruct() with NewDateMicro(),ToDateNanoStruct() with NewDateNano()
  • Replace ToTimeStruct() with NewTime(),ToTimeMilliStruct() with NewTimeMilli(),ToTimeMicroStruct() with NewTimeMicro(),ToTimeNano()Struct with NewTimeNano()
  • DateTime, DateTimeXXX,Date,DateXXX, Time,TimeXXX structures implement Scan,Value,MarshalJSON,UnmarshalJSON interfaces
  • Bump codecov/codecov-action from 4 to 5 by @dependabot in #256
  • Unified use of global default timezone defaultTimezone when UnmarshalJSON

New Contributors

Full Changelog: v2.4.1...v2.5.0

v2.4.1

15 Oct 02:08
Compare
Choose a tag to compare
  • Fix issue #240
  • Optimize StdTime method when time is zero
  • Move GormDataType from encoding.go to database.go

v2.4.0

11 Oct 16:09
Compare
Choose a tag to compare
  • Fixed Farsi language translation bug #247
  • Fixed gregorian calendar to lunar calendar bug #246
  • Updated the minimum version of Go required to 1.17 #245
  • Optimized ParseByLayout and getLocationByTimezone methods when the timezone is empty
  • Optimized the scenario of JSON unmarsha when the value of the JSON string is empty or null
  • Removed Tag struct and related methods
  • Added Arabic language support #250

v2.3.12

18 Apr 10:01
Compare
Choose a tag to compare
  • Add bulgarian language support, translated by yuksbg #234
  • Restore Datetime, Date, Time,Timestamp and other structures
  • Restore ToDateTimeStruct, ToDateStruct, ToTimeStruct,ToTimestampStruct and other methods

v2.3.11

10 Apr 02:59
Compare
Choose a tag to compare
  • Add parsing support for 2006-01-02 15:04:05-0700 MST format in Parse method
  • Return the original value instead of returning null when parsing the zero value time 0001-01-01 00:00:00 in Parse method #232
  • Optimize the judgment logic in IsValid and IsInvalid methods
  • Implement Abs method by itself in DiffAbsInDuration method #226
  • Unified unit test format

v2.3.10

05 Mar 13:31
Compare
Choose a tag to compare
  • Fixed bug when json.Unmarshaler decoded a json string containing null value
  • Add ISO8601ZuluLayout,ISO8601ZuluMilliLayout,ISO8601ZuluMicroLayout,ISO8601ZuluNanoLayout constants
  • Add FormattedDateLayout,FormattedDayDateLayout constants
  • Add ISO8601ZuluFormat,ISO8601ZuluMilliFormat,ISO8601ZuluMicroFormat,ISO8601ZuluNanoFormat constants
  • Add FormattedDateFormat,FormattedDayDateFormat constants
  • Add ToIso8601ZuluString,ToIso8601ZuluMilliString,ToIso8601ZuluMicroString,ToIso8601ZuluNanoString methods
  • Add ToFormattedDateString,ToFormattedDayDateString methods
  • Add GoString method
  • Support json strings containing null when using json.Unmarshaler #225
  • Remove deprecatedToFormatString method, use Format method instead
  • Remove deprecated ToLayoutString method, use Layout method instead

v2.3.9

20 Feb 03:30
Compare
Choose a tag to compare
  • Add DiffInDuration and DiffAbsInDuration methods
  • Add package comment for calendar/persian
  • Simplified code in calendar.go and constellation.go
  • Unified Unit Testing Method Naming Format

v2.3.8

02 Feb 08:49
Compare
Choose a tag to compare
  • Add support for Persian(Jalaali) Calendar #197
  • Add support for Polish language
  • Add W3cLayout const in carbon.go file
  • Add StdTime method to replace ToStdTime method, ToStdTime method will be deprecated in the future
  • Fix ToJulian method in calendar/julian.go file