Skip to content

Releases: brick/date-time

0.10.4

Choose a tag to compare

@BenMorel BenMorel released this 09 Oct 20:02

πŸ› Bug fixes

  • Fix LocalDateTime::plusNanos() and minusNanos() within the same second (#136 by @gnutix)

0.10.3

Choose a tag to compare

@BenMorel BenMorel released this 08 Oct 21:21

πŸ› Bug fixes

  • ZonedDateTime::of() and LocalDateTime::atTimeZone() failed for years beyond 9999 (#135 by @gnutix)
  • toNativeDateTime() and toNativeDateTimeImmutable() on LocalDateTime and ZonedDateTime failed for years beyond 9999 and negative years (#135 by @gnutix)
  • ZonedDateTime::toNativeDateTime() and toNativeDateTimeImmutable() returned the wrong offset during a DST overlap (#135 by @gnutix)

⚑️ Performance optimizations

  • Faster ZonedDateTime::of(), ofInstant() and toNativeDateTime(), and TimeZoneOffset::toNativeDateTimeZone() for UTC (#135 by @gnutix)

0.10.2

Choose a tag to compare

@BenMorel BenMorel released this 05 Oct 19:27

⚑️ Performance optimizations

  • Object-identity short-circuit in isEqualTo() and compareTo() (#130 by @gnutix)

0.10.1

Choose a tag to compare

@BenMorel BenMorel released this 03 Oct 09:19

✨ New features

  • LocalDate::getMonthDay() returns the month-day of the date (#134 by @joelbutcher)

0.10.0

Choose a tag to compare

@BenMorel BenMorel released this 30 Sep 21:03

πŸ’₯ Breaking changes

  • Instant::toISOString() and ZonedDateTime::toISOString() now always include seconds, to be RFC 3339 compliant (#131 by @dualfroz)

0.9.0

Choose a tag to compare

@BenMorel BenMorel released this 03 Jan 16:42

πŸ’₯ Breaking changes

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

0.8.1

Choose a tag to compare

@BenMorel BenMorel released this 11 Nov 15:12

✨ 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

Choose a tag to compare

@BenMorel BenMorel released this 10 Nov 23:42

πŸ’₯ 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

Choose a tag to compare

@BenMorel BenMorel released this 29 Aug 07:25

πŸ› 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

Choose a tag to compare

@BenMorel BenMorel released this 23 Jun 14:35

πŸ’₯ 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