PackageTrack
Sign in Get early access

spatie/period

Complex period comparisons

2.4.0 4.8M downloads/mo #1862 most downloaded on Packagist spatie/period

What this package is like to depend on

Last release 4 years ago

no release in 18 months

Release timing varies

gaps range from 9 days to 7 months

Nearly every release is documented

notes for 41 of 43 stable releases

Nothing withdrawn

no release was ever pulled

8 years old

43 releases · first in 2018

0 releases in the last 12 months

see the full history below

Release timeline

42 releases · Nov 2018 to Feb 2023
2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 43
  1. 2.4.0 20 Feb 2023
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 2.3.5...2.4.0

    Open source →
    Release notes

    What's Changed

    • Refactor tests to pest by @AyoobMH in https://github.com/spatie/period/pull/115
    • Add PHP 8.2 support by @patinthehat in https://github.com/spatie/period/pull/118
    • Add Dependabot Automation by @patinthehat in https://github.com/spatie/period/pull/117
    • Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/spatie/period/pull/119
    • Implement PeriodCollection Union by @EriBloo in https://github.com/spatie/period/pull/116

    New Contributors

    • @AyoobMH made their first contribution in https://github.com/spatie/period/pull/115
    • @dependabot made their first contribution in https://github.com/spatie/period/pull/119
    • @EriBloo made their first contribution in https://github.com/spatie/period/pull/116

    Full Changelog: https://github.com/spatie/period/compare/2.3.5...2.4.0

    Open source →
  2. 2.3.5 03 Oct 2022
    Release notes

    Revert previous release

    Open source →
    Release notes

    Revert previous release

    Open source →
  3. 2.3.4 03 Oct 2022
    Release notes

    Full Changelog: 2.3.3...2.3.4

    Open source →
  4. 2.3.3 03 Mar 2022
    Release notes

    Full Changelog: 2.3.2...2.3.3

    Open source →
    Release notes

    Full Changelog: https://github.com/spatie/period/compare/2.3.2...2.3.3

    Open source →
  5. 2.3.2 23 Dec 2021
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 2.3.1...2.3.2

    Open source →
  6. 2.3.1 01 Dec 2021
    Release notes

    What's Changed

    New Contributors

    Full Changelog: 2.3.0...2.3.1

    Open source →
  7. 2.3.0 14 Oct 2021
    Release notes
    • Add PeriodCollection::sort() (#97)
    Open source →
    Release notes
    • Add PeriodCollection::sort() (#97)
    Open source →
  8. 2.2.0 13 Oct 2021
    Release notes
    • Add PeriodCollection::unique() (#96)
    Open source →
    Release notes
    • Add PeriodCollection::unique() (#96)
    Open source →
  9. 2.1.3 07 Oct 2021
    Release notes
    • Don't initialize Period::asString in constructor
    Open source →
    Release notes
    • Don't initialize Period::asString in constructor
    Open source →
  10. 2.1.2 07 Oct 2021
    Release notes
    • Fix subtraction of empty PeriodCollection
    Open source →
  11. 2.1.1 11 Jun 2021
    Release notes
    • Reindex collection array after filtering values (#87)
    Open source →
  12. 2.1.0 24 Mar 2021
    Release notes
    • Add PeriodCollection::subtract(PeriodCollection|Period $others) (#84)
    • Rename parameter PeriodCollection::overlap(PeriodCollection $others)
    • Rename parameter PeriodCollection::overlapAll(PeriodCollection ...$others)
    Open source →
  13. 2.0.0 17 Mar 2021
    Release notes
    • Bump required PHP version to ^8.0
    • Fix bug with overlapAll when no overlap
    • All period properties are now typed, this affects you if you extend from Period or PeriodCollection
    • Return types of several methods have been changed from Period to static
    • Period::duration() returns an instance of PeriodDuration
    • Period::length() now uses the Period's precision instead of always returning days
    • Period::overlap() renamed to Period::overlapAny()
    • Period::overlapSingle() renamed to Period::overlap()
    • Period::diff() renamed to Period::subtract()
    • Period::subtract() (previously diff) no longer returns the gap when there's no overlap
    • Period::diffSingle() renamed to Period::diffSymmetric()
    • Period::contains() now accepts both DateTimeInterface and Period
    • PeriodCollection::overlap() now accepts one or several periods
    • Renamed all getters like getIncludedEnd() and getStart() to includedEnd() and start(), etc.
    • Add Period::fromString()
    • Add Period::asString()
    Open source →
  14. 1.6.1 13 Dec 2021
    Release notes
    • Support PHP 8.1

    Full Changelog: 1.6.0...1.6.1

    Open source →
  15. 1.6.0 24 Feb 2021
    Release notes
    • Add Period::renew (#74)
    Open source →
  16. 1.5.3 03 Dec 2020
    Release notes
    • PHP8 compatibility
    Open source →
  17. 1.5.2 19 Nov 2020
    Release notes
    • Keep timezone when boundaries are timezoned (#71)
    Open source →
  18. 1.5.1 21 Oct 2020
    Release notes
    • Support multiple precisions when checking touchesWith (#68)
    Open source →
  19. 1.5.0 31 Mar 2020
    Release notes
    • Add filter to PeriodCollection
    Open source →
  20. 1.4.5 05 Feb 2020
    Release notes
    • Fix for PeriodCollection::gaps() with excluded boundaries (#58)
    Open source →
  21. 1.4.4 05 Aug 2019
    Release notes
    • ~Performance improvement in Period::contains() (#46)~ edit: this change wasn't merged and targeted at 2.0
    Open source →
  22. 1.4.3 09 Jul 2019
    Release notes
    • ~Improve iterator performance (#42)~ edit: this change wasn't merged and targeted at 2.0
    Open source →
  23. 1.4.2 27 May 2019
    Release notes
    • Allow extension of Period that forces extension of DateTimeImmutable (#38)
    Open source →
  24. 1.4.1 23 Apr 2019
    Release notes
    • Support PeriodCollection::make()
    • Improved PeriodCollection doc blocks
    Open source →
  25. 1.4.0 23 Apr 2019
    Release notes
    • Add map and reduce to PeriodCollection
    Open source →
  26. 1.3.1 19 Apr 2019
    Release notes
    • Remove unused code
    Open source →
  27. 1.3.0 19 Apr 2019
    Release notes
    • Add period collection add
    Open source →
  28. 1.2.0 19 Apr 2019
    Release notes
    • Add period collection intersect
    Open source →
  29. 1.1.3 05 Apr 2019
    Release notes
    • Even better docblock support for static return types
    Open source →
  30. 1.1.2 05 Apr 2019
    Release notes
    • Better docblock support for static return types
    Open source →
  31. 1.1.1 01 Feb 2019
    Release notes
    • Fix bug with null element in diff
    Open source →
  32. 1.1.0 26 Jan 2019
    Release notes
    • Make Period iterable
    Open source →
  33. 1.0.0 17 Jan 2019
    Release notes
    • First stable release
    Open source →
  34. 0.5.1 14 Jan 2019
    Release notes
    • Fix bug with precision not being correctly copied
    Open source →
  35. 0.5.0 09 Jan 2019
    Release notes
    • Add boundary and precision support
    Open source →
  36. 0.4.1 08 Jan 2019
    Release notes
    • No overlap returns empty collection
    Open source →
  37. 0.4.0 19 Dec 2018
    Release notes
    • Add visualizer
    Open source →
  38. 0.3.3 18 Dec 2018
    Release notes
    • Support edge case for two period diffs
    Open source →
  39. 0.3.2 11 Dec 2018
    Release notes
    • Add better return types to support inherited periods
    Open source →
  40. 0.3.1 30 Nov 2018

    Nothing published for this version

  41. 0.3.0 no date
    Release notes
    • Add Period::contains
    Open source →
  42. 0.2.0 29 Nov 2018
    Release notes
    • Initial dev release
    Open source →
  43. 0.1.0 27 Nov 2018

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive