awd-studio/vo-date-time
Immutable PHP 8.3+ date-time value object. Create from strings, compare (equal/greater/less/between), and return new instances for changes like nextDay(), copy(), or modified() with DateTimePeriod offsets (days, minutes, weeks).
DateTime operations.isBetween(), isGreaterThan()) to eliminate edge-case bugs in subscription billing, event scheduling, or compliance deadlines.DateTimeImmutable).spatie/calendar or ramsey/recurring-event.DateTime comparisons (e.g., >= vs. > edge cases)."This package lets us treat dates as immutable ‘value objects’—like frozen time snapshots that can’t be accidentally modified. For example, in our subscription system, we can safely compare renewal dates without worrying about timezone bugs or race conditions. It’s a lightweight way to make our date logic more reliable, directly reducing support costs for edge cases like missed deadlines or billing errors. The tradeoff is minimal: a tiny dependency that pays off in fewer bugs and cleaner code. We’d trial it in the billing module first to validate the impact."
*"This is a PHP 8.3+ value object wrapper for dates that enforces immutability and adds useful methods like isBetween(), modified(), and nextDay(). Key benefits:
DateTime: No accidental mutations; ideal for concurrent environments.isGreaterThan() replace verbose > checks.Order::dueDate() returns a DateTime VO).Proposal:
InvalidArgumentExceptions).Alternatives considered:
Risk: Low—package is actively maintained (last release March 2025) and aligns with modern PHP practices."*
How can I help you explore Laravel packages today?