Skip to content

Releases: briannesbitt/Carbon

1.26.1

16 Apr 13:30
bab61b2
Compare
Choose a tag to compare

Change macros variable name to coexist with Laravel's one

1.26.0...1.26.1

1.26.0

16 Apr 11:37
bab61b2
Compare
Choose a tag to compare

Complete commits list: 1.25.0...1.26.0

Summary:

  • Added setDateFrom and setTimeFrom methods
  • Allowed DateTimeInterface in instance method
  • Added macro, hasMacro and mixin methods
  • Added welsh language
  • Added CarbonInterval::getDateIntervalSpec (similar to CarbonInterval::spec but static and able to take any DateInterval instance as argument)
  • Added options for diffForHumans to support now/yesterday/tomorrow (#1240)

1.25.0

20 Mar 14:45
cbcf13d
Compare
Choose a tag to compare

Complete commits list: 1.24.2...1.25.0

Summary:

  • Allowed date/time strings in diffIn* and diffForHumans methods
  • Added addRealHours()/addRealHour()/subRealHours()/subRealHour() method
  • Added addRealMinutes()/addRealMinute()/subRealMinutes()/subRealMinute() method
  • Added addRealSeconds()/addRealSecond()/subRealSeconds()/subRealSecond() method
  • Added diffInRealHours() method
  • Added diffInRealMinutes() method
  • Added diffInRealSeconds() method
  • Added Carbon::createFromTimeString() method
  • Added CarbonInterval::fromString() method
  • Allowed spec string as CarbonInterval constructor and in CarbonInterval::parse()
  • Added Carbon::useMicrosecondsFallback() and Carbon::isMicrosecondsFallbackEnabled() to handle microseconds work-around in PHP < 7.1
  • Added dayOfWeekIso property
  • Allowed editing/adding languages and translations

1.24.2

12 Mar 08:01
bba6c6e
Compare
Choose a tag to compare

Prevent from negative values in microtime

Complete commits list: 1.24.1...1.24.2

1.24.1

09 Mar 15:50
ef12cbd
Compare
Choose a tag to compare

Re-align __set_state on DateTime method to ease Laravel compatibility

Complete commits list: 1.24.0...1.24.1

1.24.0: Merge pull request #1169 from Glavic/phpcs-fix

09 Mar 15:03
a05bed2
Compare
Choose a tag to compare

Complete commits list: 1.23.0...1.24.0

Summary:

  • Added createMidnightDate() method
  • Added isLastOfMonth() method
  • Added isDayOfWeek() method
  • Added toRfc7231String() method
  • Added toIso8601ZuluString() method
  • Added hasFormat() method
  • Added toArray() method
  • Added startOfHour() method
  • Added endOfHour() method
  • Added startOfMinute() method
  • Added endOfMinute() method
  • Added midDay() dynamic method, and getMidDayAt, setMidDayAt static methods
  • Added nowWithSameTz() method
  • Added CarbonInterval::compare() method
  • Added year overflow support (addYearsNoOverflow, addYearNoOverflow, addYearsWithOverflow, addYearWithOverflow, subYearNoOverflow, subYearsNoOverflow, subYearWithOverflow, subYearsWithOverflow dynamic methods and useYearsOverflow, resetYearsOverflow, shouldOverflowYears static methods)
  • Added microseconds on calling now with PHP < 7.1 (PHP >= 7.1 still support it natively)
  • Fixed hasRelativeKeywords() that no longer guess if the string is relative but test if it really produces a relative date, making it more accurate
  • Fixed createSafe(), now throws an exception with PHP >= 5.4 if the time is in a hour skipped by daylight saving time
  • Allowed DateTime and DateTimeInterface in diff methods

1.23.0

28 Feb 15:26
4a874a3
Compare
Choose a tag to compare

Complete commits list: 1.22.1...1.23.0

Summary:

  • Add ->weekNumberInMonth property
  • Add $parts arguments to diffForHumans() to allow components diff like "1 week 2 days 11 hours"
  • Add createFromTimestampMs method to create from timestamp in milliseconds
  • Fix/complete translations: ar, az, bg, el, fr, hy (arm), ja, pl, sk, sr, th, uk, uz, zh
  • Add translations: ar_shakl, dv_MV, kk, mn, ps, sr_Cyrl
  • Add Carbon::getDays() returning week days codes
  • getLastErrors() now works also on construct
  • Add workaround for setTimezone bug: https://bugs.php.net/bug.php?id=72338
  • Now Carbon instances can be exported via var_export and recreated with the produced code
  • Compatible with Symfony 4
  • Dates can be mocked now with microseconds
  • Workaround for the coma decimal separator PHP bug https://bugs.php.net/bug.php?id=67127
  • Allow formatLocalized no matter if a custom toStringFormat has been set
  • isSame*() methods now also accept DateTime instances
  • Handle daylight saving time in a better way

1.22.1

06 Mar 13:31
Compare
Choose a tag to compare

1.22.0

06 Mar 13:31
Compare
Choose a tag to compare

1.21.0

06 Mar 13:31
Compare
Choose a tag to compare
Turns out travis doesn't have 5.3.6 ... removing specific 5.3.X versi…