Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Date Time Precision Laravel Package

digital-craftsman/date-time-precision

Thin PHP value objects for precise date/time concepts: Moment (UTC-backed) plus Time, Date, Month, Year, Day, Weekday and collections. Avoid misleading DateTime comparisons, handle timezone-safe modifications (DST), with Symfony normalizers and Doctrine types.

View on GitHub
Deep Wiki
Context7
v0.14.0
  • Added class for Day.
  • Added class for Days.
  • Breaking change: Updated $day value of Month to be a Day instead of an int.
v0.13.1
  • Fixed version constraint of self-aware-normalizers
v0.13.0
  • Updated registration to auto registration for doctrine types.
  • Deprecated previous doctrine types.
v0.12.0
  • Added support for PHP 8.5.
  • Dropped support for PHP 8.3.
  • Added support for Symfony ^8.0.
  • Dropped support for Symfony 7.3 and below. Only the 7.4 LTS version is still supported.
v0.11.1
  • Updated digital-craftsman/self-aware-normalizers to use the first stable version.
v0.11.0
  • Breaking change: Removed deprecated isDate* methods from Moment.
  • Breaking change: Dropped custom normalizers in favor of digital-craftsman/self-aware-normalizers.
  • Breaking change Dropped support for PHP 8.2.
  • Added Clock implementation with SystemClock and FrozenClock.
  • Added guard methods for comparison methods to Moment, Date and Time like mustBeEqualTo with option to throw custom exception.
  • Changed normalization of Moment to include microseconds.
  • Added support for PHP 8.4.
v0.10.0
  • Added is*InTimeZone(Time | Date | Month | Year $equalTo, \DateTimeZone $timeZone): bool methods to Moment.
  • Added missing methods to precision classes.
  • Deprecated isDate*InTimeZone methods from Moment.
v0.9.0
  • Breaking change: Dropped support for Symfony 6.3.
  • Added support for Symfony 7.
  • Fixed naming in functions of Moment class. Parameter was called $dateTime, but should have been $moment.
v0.8.1
  • Added missing return type in DateTimePrecisionExtension.
v0.8.0
  • Breaking change: Dropped support for PHP 8.1.
  • Breaking change: Dropped support for Symfony below 6.3.
  • Breaking change: Instances of DateTime are now always created in the UTC timezone (independent on the configured default timezone in PHP).
  • Breaking change: Renamed package to digital-craftsman/date-time-precision.
  • Breaking change: Renamed DateTime to Moment including normalizer and Doctrine type.
  • Breaking change: Updated Doctrine moment type to support milliseconds.
  • Added support for PHP 8.3.
  • Added support for the new normalizer caching mechanism of Symfony 6.3.
  • Switched classes to be readonly (instead of just the properties).
  • Automatically register the Doctrine types.
  • Removed custom code in Date and Month and used PHP SPL to handle date comparisons.
  • Added DateTime->isNotAfter
  • Added DateTime->isNotAfterOrEqualTo.
  • Added DateTime->isNotBeforeOrEqualTo.
  • Added DateTime->isNotBefore.
  • Added DateTime->isDateNotAfterInTimeZone.
  • Added DateTime->isDateNotAfterOrEqualToInTimeZone.
  • Added DateTime->isDateNotBeforeInTimeZone.
  • Added DateTime->isDateNotBeforeOrEqualToInTimeZone.
  • Added Date->isNotAfter.
  • Added Date->isNotBefore.
  • Added Date->isNotBeforeOrEqualTo.
  • Added Date->isNotAfterOrEqualTo.
  • Added Month->isNotBefore.
  • Added Month->isNotBeforeOrEqualTo.
  • Added Month->isNotAfter.
  • Added Month->isNotAfterOrEqualTo.
  • Added Year->isNotBefore.
  • Added Year->isNotAfterOrEqualTo.
  • Added Year->isNotAfter.
  • Added Year->isNotBeforeOrEqualTo.
v0.7.0
  • Added Date->datesUntil(Date $date, PeriodLimit $periodLimit = PeriodLimit::INCLUDING_START_AND_END): array.
  • Added Year->yearsUntil(Year $year, PeriodLimit $periodLimit = PeriodLimit::INCLUDING_START_AND_END): array.
  • Added Year->modify(string $modifier): Year.
v0.6.1
  • Added missing DateTimeType->requiresSQLCommentHint(): bool.
  • Added missing DateType->requiresSQLCommentHint(): bool.
  • Added missing TimeType->requiresSQLCommentHint(): bool.
v0.6.0
  • Added Year->compareTo(self $year): int.
  • Added Month->compareTo(self $month): int.
  • Added Date->compareTo(self $date): int.
  • Updated Time->compareTo(self $time): int to use less custom code.
v0.5.0
  • Added DateTime->isDateNotEqualToInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool.
  • Added Date->toDateTimeInTimeZone(\DateTimeZone $timeZone): self.
  • Added Date->modifyInTimeZone(string $modify, \DateTimeZone $timeZone): self.
  • Added Month->toDateTimeInTimeZone(\DateTimeZone $timeZone): self.
  • Added Month->modifyInTimeZone(string $modify, \DateTimeZone $timeZone): self.
  • Added Year->toDateTimeInTimeZone(\DateTimeZone $timeZone): self.
  • Added Year->modifyInTimeZone(string $modify, \DateTimeZone $timeZone): self.
  • Added YearNormalizer to automatic registered normalizers.
v0.4.0
  • Added isDateAfterInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool in DateTime.
  • Added isDateAfterOrEqualToInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool in DateTime.
  • Added isDateEqualToInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool in DateTime.
  • Added isDateBeforeInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool in DateTime.
  • Added isDateBeforeOrEqualToInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool in DateTime.
v0.3.0
  • Renamed $monthOfYear to $month in Month.
  • Renamed $dayOfMonth to $day in Date.
  • Added isAtMidnight(): bool in DateTime.
  • Added isNotAtMidnight(): bool in DateTime.
  • Added isAtMidnightInTimeZone(\DateTimeZone $timeZone): bool in DateTime.
  • Added isNotAtMidnightInTimeZone(\DateTimeZone $timeZone): bool in DateTime.
  • Added setTimeInTimeZone(Time $time, \DateTimeZone $timeZone): self in DateTime.
v0.2.0
  • Added DateTime->formatInTimeZone.
v0.1.0

Initial release compatible with PHP 8.1 and PHP 8.2 (RC version), including 100% code coverage and 100% MSI coverage.

v0.1.0-beta.2
v0.1.0-beta.1
v0.1.0-alpha.5
v0.1.0-alpha.4
v0.1.0-alpha.3
v0.1.0-alpha.2
v0.1.0-alpha.1
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony
spatie/flare-daemon-runtime