Skip to content

Releases: brick/date-time

0.5.2

16 Sep 22:40
Compare
Choose a tag to compare

⚡️ Performance optimizations

  • These methods got a small performance boost: Local(Date|Time|DateTime) minOf()/maxOf() (#76)
  • Static objects returned by factory methods are now cached (#77)
  • The special case LocalDate::plusDays(1) is now much faster (#79)

Thanks to @gnutix and @BastienClement!

0.5.1

01 Aug 09:20
Compare
Choose a tag to compare

New methods

0.5.0

25 Jun 21:15
Compare
Choose a tag to compare

💥 Breaking changes

  • Deprecated Interval constructor is now private; please use Interval::of() instead

  • The following deprecated methods have been removed, please use the new names:

    Class Name Old Method Name New Method Name
    LocalDate fromDateTime() fromNativeDateTime()
    LocalDate toDateTime() toNativeDateTime()
    LocalDate toDateTimeImmutable() toNativeDateTimeImmutable()
    LocalDateRange toDatePeriod() toNativeDatePeriod()
    LocalDateTime fromDateTime() fromNativeDateTime()
    LocalDateTime toDateTime() toNativeDateTime()
    LocalDateTime toDateTimeImmutable() toNativeDateTimeImmutable()
    LocalTime fromDateTime() fromNativeDateTime()
    LocalTime toDateTime() toNativeDateTime()
    LocalTime toDateTimeImmutable() toNativeDateTimeImmutable()
    Period fromDateInterval() fromNativeDateInterval()
    Period toDateInterval() toNativeDateInterval()
    TimeZone fromDateTimeZone() fromNativeDateTimeZone()
    TimeZone toDateTimeZone() toNativeDateTimeZone()
    ZonedDateTime fromDateTime() fromNativeDateTime()
    ZonedDateTime toDateTime() toNativeDateTime()
    ZonedDateTime toDateTimeImmutable() toNativeDateTimeImmutable()

0.4.3

20 Jun 10:47
Compare
Choose a tag to compare

🔧 Improvements

  • TimeZoneOffset::parse() return type has been narrowed to TimeZoneOffset
  • Support for seconds in TimeZoneOffset has been added back (#60) (@jiripudil)

🐛 Bug fixes

  • Old date/times could fail to be parsed by ZonedDateTime due to sub-minute timezone offsets (#44)

0.4.2

19 May 21:34
Compare
Choose a tag to compare

New methods

  • Duration::isGreaterThanOrEqualTo() (#50)
  • Duration::isLessThanOrEqualTo() (#50)
  • Interval::of() (#64)
  • Interval::contains() (#64)
  • Interval::intersectsWith() (#64)
  • Interval::getIntersectionWith() (#64)
  • Interval::isEqualTo() (#64)

💩 Deprecations

  • Interval constructor is deprecated in favour of Interval::of() (#64)

Thanks to @ihmels and @someniatko!

0.4.1

18 Jun 22:07
Compare
Choose a tag to compare

New methods

  • LocalDateRange::toPeriod() (#51)
  • Year::toLocalDateRange() (#46)
  • YearMonth::toLocalDateRange() (#46)
  • YearMonthRange::toLocalDateRange() (#46)
  • YearWeek::toLocalDateRange() (#46)

💩 Deprecations

The following methods have been deprecated in favour of new names (#47):

  • Period::fromDateInterval()fromNativeDateInterval()
  • Period::toDateInterval()toNativeDateInterval()
  • TimeZone::fromDateTimeZone()fromNativeDateTimeZone()
  • TimeZone::toDateTimeZone()toNativeDateTimeZone()
  • LocalTime::fromDateTime()fromNativeDateTime()
  • LocalTime::toDateTime()toNativeDateTime()
  • LocalTime::toDateTimeImmutable()toNativeDateTimeImmutable()
  • LocalDateRange::toDatePeriod()toNativeDatePeriod()
  • LocalDate::fromDateTime()fromNativeDateTime()
  • LocalDate::toDateTime()toNativeDateTime()
  • LocalDate::toDateTimeImmutable()toNativeDateTimeImmutable()
  • ZonedDateTime::fromDateTime()fromNativeDateTime()
  • ZonedDateTime::toDateTime()toNativeDateTime()
  • ZonedDateTime::toDateTimeImmutable()toNativeDateTimeImmutable()
  • LocalDateTime::fromDateTime()fromNativeDateTime()
  • LocalDateTime::toDateTime()toNativeDateTime()
  • LocalDateTime::toDateTimeImmutable()toNativeDateTimeImmutable()

Thanks to @solodkiy, and to @tigitz for introducing long overdue coding standards!

0.4.0

23 Dec 00:04
Compare
Choose a tag to compare

💥 Breaking changes

  • Minimum PHP version is now 7.4
  • TimeZoneOffset does not allow seconds anymore (#35):
    • TimeZoneOffset::of()'s $seconds parameter is removed
    • TimeZoneOffset::ofTotalSeconds() now throws if the number of seconds is not a multiple of 60
    • IsoParsers::timeZoneOffset() does not allow seconds in timezone offset anymore; this affects not only TimeZoneOffset:parse() but also ZonedDateTime::parse()

🔧 Fix

  • Fixed return type of TimeZoneRegion::parse() (#38) Thanks to @adrianguenter

New methods

  • Period::fromDateInterval() converts a native DateInterval object to Period

0.3.2

30 Jun 17:13
Compare
Choose a tag to compare

New methods

  • DayOfWeek::isWeekday()
  • DayOfWeek::isWeekend()
  • LocalDate::plusWeekdays()
  • LocalDate::minusWeekDays()

0.3.1

29 Jun 20:18
Compare
Choose a tag to compare

New methods

  • LocalDateRange::withStart()
  • LocalDateRange::withEnd()

0.3.0

24 Apr 20:34
Compare
Choose a tag to compare

💥 Breaking changes

  • The following methods now have return types:
    • Brick\DateTime\DayOfWeek::monday() through sunday()
    • Brick\DateTime\DayOfWeek::__toString()
    • Brick\DateTime\Month::__toString()