Skip to content

Releases: dromara/carbon

v2.3.7

26 Jan 02:31
Compare
Choose a tag to compare
  • Support julian day and modified julian day #197
  • Fix overflow int in windows386 #219
  • Remove lunar DoubleHour, IsXXXDoubleHour methods

v2.3.6

22 Jan 09:03
Compare
Choose a tag to compare
  • Extract the calendar as an independent sub package
  • Add CreateFromLunar method, create a Carbon instance from Lunar date and time
  • Fix concurrent map read and map write in ToMonthString, ToShortMonthString,ToWeekString, ToShortWeekString, Season , Constellation methods #180
  • Improve unit and benchmark test coverage

v2.3.5

12 Jan 02:42
Compare
Choose a tag to compare
  • Default struct add Locale field for setting the global local language
  • Add timezone constants
  • Add IsAM, IsPM methods
  • Add Max, Min methods
  • Optimize LoadTag method and replace strings.Contains with strings.HasPrefix
  • Improve unit and benchmark test coverage

v2.3.4

07 Jan 12:19
Compare
Choose a tag to compare
  • Add Default struct and SetDefault method for setting global default values #215
  • Move SetLanguage method from setter.go to language.go
  • SetLocale and SetResources methods return *Language
  • Improve unit and benchmark coverage

v2.3.3

03 Jan 17:40
Compare
Choose a tag to compare
  • Add Hindi language support
  • Add Vietnamese language support
  • Optimize code
  • carbon:"xxx" -> carbon:"type:xxx"

v2.3.2

02 Jan 15:54
Compare
Choose a tag to compare
  • Add optional timezone parameter in CreateFromStdTime method
  • Add tag embedded struct in Carbon struct
  • Add India constant in timezone constants
  • Optimize LoadTag and parseTag method
  • Set to Local timezone by default in database function func (c *Carbon) Scan(v interface{})
  • Improve benchmark testing coverage

v2.3.1

28 Dec 06:50
Compare
Choose a tag to compare
  • Fix testNow is 0 when setting test now in Now method
  • Add benchmark test files xxx_bench_test.go
  • Add format constants, such as DateTimeFormat, DateFormat, TimeFormat, AtomFormat, ANSICFormat ...
  • Add support carbon tag of struct carbon type field for datetime, date, time, iso8601 and other strings in LoadTag method
  • Add support tz tag of struct carbon type field in loadTag function, use to set timezone #207
  • Add support for U, V, X, Z formatting symbols in ParseByLayout method #206
  • Add support for v, u, x formatting symbols in ToFormatString or Format method
  • Rename ClearTestNow method to UnSetTestNow
  • Rename HasTestNow method to IsSetTestNow
  • Rename xxx_test.go file to xxx_unit_test.go
  • Rename json.go file to encoding.go, json_test.go file to encoding_unit_test.go
  • Move Closest and Farthest methods from traveler.go to extremum.go, traveler_test.go to extremum_unit_test.go
  • ⚠️Change receiver type from struct to pointer in SetTestNow method

v2.3.0

25 Dec 02:17
Compare
Choose a tag to compare
  • Fix error in DiffInMonths method
  • Add LoadTag method, use carbon and tz tags for Marshal and Unmarshal
  • Rename ToANSICString method to ToAnsicString
  • Set nanoseconds default to 0 in CreateFromDateTime method
  • Set hours, minutes and seconds default to 0 in CreateFromDate method #205
  • Output different formats according to different tags in String method
  • Move GormDataType method from json.go to database.go
  • ⚠️ Remove the deprecated FromStdTime, Time2Carbon, Carbon2Time methods
  • ⚠️ Remove DateTime,DateTime, DateTimeMilli, DateTimeMicro, DateTimeMicro, DateTimeNano, Date, DateMilli, DateMicro , DateNano, Timestamp, TimestampMilli, TimestampMicro, TimestampNano structs and related methods

v2.2.14

30 Nov 23:18
Compare
Choose a tag to compare
  • Fix ToWeekString and ToShortWeekStringmethods ignores SetWeekStartsAt #200
  • Add more supported formats for Parse method #202
  • Change timezone[len(timezone)-1] to timezone[0]
  • Increase unit testing coverage for Fastest method

v2.2.13

07 Nov 07:07
Compare
Choose a tag to compare
  • Fix translation error in lang/fr.json and lang/jp.json files
  • Fix bug in IsZero method #194
  • Add IsDST method
  • Add Closest and Farthest methods
  • Rename from modifier.go to boundary.go, modifier_test.go to boundary_test.go