Skip to content

Releases: brick/date-time

0.1.10

08 Mar 18:11
Compare
Choose a tag to compare

LocalDateRange::getIterator() is now type-hinted as LocalDate[] to allow static code analysis in IDEs.

0.1.9

14 Nov 13:08
Compare
Choose a tag to compare

New method: LocalDate::daysUntil()

This allows to get the number of days between two dates.

0.1.8

29 Oct 17:34
Compare
Choose a tag to compare

New methods to convert objects to native DateTimeImmutable objects:

  • LocalDate::toDateTimeImmutable()
  • LocalTime::toDateTimeImmutable()
  • LocalDateTime::toDateTimeImmutable()
  • ZonedDateTime::toDateTimeImmutable()

0.1.7

18 Oct 13:26
Compare
Choose a tag to compare

New methods to convert to native DateTime objects:

  • LocalDate::toDateTime()
  • LocalTime::toDateTime()
  • LocalDateTime::toDateTime()

This makes these methods in line with their fromDateTime() counterparts.

Note: even though these classes represent partial date-time concepts, PHP merges all these concepts into a single DateTime class, so it is relevant to be able to easily export them as native PHP date-times, with sensible defaults.

0.1.6

18 Oct 12:24
Compare
Choose a tag to compare

New method:

ZonedDateTime::toDateTime() : converts the ZonedDateTime to a native DateTime object.

0.1.5

13 Oct 20:28
Compare
Choose a tag to compare

New factory method:

  • Duration::ofMilliseconds()

0.1.4

14 Mar 22:26
Compare
Choose a tag to compare

New methods available to create objects from native DateTime or DateTimeImmutable objects:

  • LocalDate::fromDateTime()
  • LocalTime::fromDateTime()
  • LocalDateTime::fromDateTime()
  • ZonedDateTime::fromDateTime()

0.1.3

06 Feb 17:51
Compare
Choose a tag to compare

This release adds support for YearWeek.

0.1.2

04 Oct 15:15
Compare
Choose a tag to compare

Bug fix:

  • Duration::multipliedBy() could return an invalid Duration with negative nanos

New methods:

  • Instant::toDecimal() returns a decimal timestamp such as 123456789.123456
  • FixedClock::move() allows to move the clock by a number of seconds and/or nanos

New clock implementation:

  • ScaleClock makes the time move at a given pace

New feature:

  • Methods such as now() now use the clock returned by DefaultClock. By default, this clock is still SystemClock, but it can now be overridden in tests. DefaultClock offers the freeze(), travel() and scale() methods inspired by timecop.

0.1.1

04 Oct 10:41
Compare
Choose a tag to compare

ZonedDateTime::isPast() and isFuture() now accept an optional Clock parameter.