Skip to content

Releases: brick/date-time

0.9.0

03 Jan 16:42

Choose a tag to compare

💥 Breaking changes

  • Minimum PHP version is now 8.2
  • The following classes are now final:
    • YearMonthRange
    • ZonedDateTime
    • Parser\DateTimeParseException

0.8.1

11 Nov 15:12

Choose a tag to compare

Compatibility improvements

  • The following parser and parse methods now accept hours only in timezone offsets, such as +01 equivalent to +01:00 (#123 by @antonkomarev):
    • IsoParsers:timeZoneOffset()
    • TimeZoneOffset::parse()
    • ZonedDateTime::parse()

0.8.0

10 Nov 23:42

Choose a tag to compare

💥 Breaking changes

  • Duration::toISOString() and __toString() now output negative durations as -P... (#122 by @BastienClement)
    Example: -PT2H21M instead of PT-2H-21M.
    This aligns with ISO 8601-2:2019 and improves compatibility with the JavaScript Temporal API.

0.7.1

29 Aug 07:25

Choose a tag to compare

🐛 Bug fixes

  • ZoneDateTime incorrectly handled DST Transitions with relative time addition (#115)

New features

  • LocalDate::getQuarter() and getQuarterValue() return the quarter of the year (#114 by @pscheit)

0.7.0

23 Jun 14:35

Choose a tag to compare

💥 Breaking changes

  • DayOfWeek:
    • deprecated method of() has been removed, use DayOfWeek::from() instead
    • the following deprecated methods have been removed, use enum values instead:
      • DayOfWeek::monday()DayOfWeek::MONDAY
      • DayOfWeek::tuesday()DayOfWeek::TUESDAY
      • DayOfWeek::wednesday()DayOfWeek::WEDNESDAY
      • DayOfWeek::thursday()DayOfWeek::THURSDAY
      • DayOfWeek::friday()DayOfWeek::FRIDAY
      • DayOfWeek::saturday()DayOfWeek::SATURDAY
      • DayOfWeek::sunday()DayOfWeek::SUNDAY
    • deprecated method getValue() has been removed, use $dayOfWeek->value instead
    • deprecated method is() has been removed, compare values with $dayOfWeek or $dayOfWeek->value instead
    • deprecated method isEqualTo() has been removed, use strict equality === between DayOfWeek instances instead.
  • DefaultClock:
    • deprecated method travel() has been removed, use travelTo() instead
  • LocalDate:
    • deprecated method getDay() has been removed, use getDayOfMonth() instead
    • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
  • LocalDateTime:
    • deprecated method getDay() has been removed, use getDayOfMonth() instead
    • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
  • Month:
    • deprecated method of() has been removed, use Month::from() instead
    • deprecated method getAll() has been removed, use Month::cases() instead
    • deprecated method getValue() has been removed, use $month->value instead
    • deprecated method is() has been removed, compare values with $month or $month->value instead
    • deprecated method isEqualTo() has been removed, use strict equality === between Month instances instead
  • MonthDay:
    • deprecated method getDay() has been removed, use getDayOfMonth() instead
    • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
  • YearMonth:
    • getMonth() now returns a Month enum; use getMonthValue() if you want the month number
  • ZonedDateTime:
    • deprecated method getDay() has been removed, use getDayOfMonth() instead
    • getMonth() now returns a Month enum; use getMonthValue() if you want the month number

🔧 Improvements

  • Methods returning int are now type-annotated with int ranges

0.6.5

19 Jun 21:35

Choose a tag to compare

New methods

  • LocalDate::previousDayOfWeek()
  • LocalDate::previousOrSameDayOfWeek()
  • LocalDate::nextDayOfWeek()
  • LocalDate::nextOrSameDayOfWeek()

0.6.4

25 Apr 09:55

Choose a tag to compare

New features

  • DefaultClock::travelBy() travels in time by a duration (#92)

🗑️ Deprecations

  • DefaultClock::travel() is now deprecated in favour of travelTo() (#92)

Thanks to @francislavoie!

0.6.3

02 Apr 21:19

Choose a tag to compare

New features

  • Stopwatch::stop() now returns the lap duration (#98)

Thanks to @rodnaph!

0.6.2

01 Apr 15:26

Choose a tag to compare

New features

  • MonthDay::of() and MonthDay::withMonth() now accept a Month enum as parameter (#106)
  • LocalDate::of() and LocalDate::withMonth() now accept a Month enum as parameter (#106)
  • LocalDateTime::of() and LocalDateTime::withMonth() now accept a Month enum as parameter (#106)
  • ZonedDateTime::withMonth() now accepts a Month enum as parameter (#106)

Undeprecations

  • Passing an int to Year::atMonth() is un-deprecated, and now valid again (#103)
  • Passing an int to YearMonth::of() and YearMonth::withMonth() is un-deprecated, and now valid again (#103)
  • Passing an int to YearWeek::atDay() is un-deprecated, and now valid again (#103)

Thanks to @gnutix!

0.6.1

26 Mar 22:31

Choose a tag to compare

New features

  • Year::atMonth() now accepts a Month enum as parameter (#95)
  • YearMonth::of() and YearMonth::withMonth() now accept a Month enum as parameter (#96)

🔧 Improvements

  • Narrower Psalm types for compareTo(), __toString(), toISOString(), jsonSerialize() methods (#97)

💩 Deprecations

  • Passing an int to Year::atMonth() is now deprecated, pass a Month enum instead (#95)
  • Passing an int to YearMonth::of() and YearMonth::withMonth() is now deprecated, pass a Month enum instead (#96)

Thanks to @gnutix!