digital-craftsman/date-time-precision
PHP/Symfony package wrapping DateTime in precise value objects: Moment, Time, Date, Month, Year, Day and Weekday, plus collections. Keeps UTC internally and converts to the relevant timezone for modifications. Includes Symfony normalizers and Doctrine types, and is thoroughly tested.
Moment class. Parameter was called $dateTime, but should have been $moment.DateTimePrecisionExtension.DateTime are now always created in the UTC timezone (independent on the configured default timezone in PHP).digital-craftsman/date-time-precision.DateTime to Moment including normalizer and Doctrine type.readonly (instead of just the properties).Date and Month and used PHP SPL to handle date comparisons.DateTime->isNotAfterDateTime->isNotAfterOrEqualTo.DateTime->isNotBeforeOrEqualTo.DateTime->isNotBefore.DateTime->isDateNotAfterInTimeZone.DateTime->isDateNotAfterOrEqualToInTimeZone.DateTime->isDateNotBeforeInTimeZone.DateTime->isDateNotBeforeOrEqualToInTimeZone.Date->isNotAfter.Date->isNotBefore.Date->isNotBeforeOrEqualTo.Date->isNotAfterOrEqualTo.Month->isNotBefore.Month->isNotBeforeOrEqualTo.Month->isNotAfter.Month->isNotAfterOrEqualTo.Year->isNotBefore.Year->isNotAfterOrEqualTo.Year->isNotAfter.Year->isNotBeforeOrEqualTo.Date->datesUntil(Date $date, PeriodLimit $periodLimit = PeriodLimit::INCLUDING_START_AND_END): array.Year->yearsUntil(Year $year, PeriodLimit $periodLimit = PeriodLimit::INCLUDING_START_AND_END): array.Year->modify(string $modifier): Year.DateTimeType->requiresSQLCommentHint(): bool.DateType->requiresSQLCommentHint(): bool.TimeType->requiresSQLCommentHint(): bool.Year->compareTo(self $year): int.Month->compareTo(self $month): int.Date->compareTo(self $date): int.Time->compareTo(self $time): int to use less custom code.DateTime->isDateNotEqualToInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool.Date->toDateTimeInTimeZone(\DateTimeZone $timeZone): self.Date->modifyInTimeZone(string $modify, \DateTimeZone $timeZone): self.Month->toDateTimeInTimeZone(\DateTimeZone $timeZone): self.Month->modifyInTimeZone(string $modify, \DateTimeZone $timeZone): self.Year->toDateTimeInTimeZone(\DateTimeZone $timeZone): self.Year->modifyInTimeZone(string $modify, \DateTimeZone $timeZone): self.YearNormalizer to automatic registered normalizers.DateTime->isDateAfterInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool.DateTime->isDateAfterOrEqualToInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool.DateTime->isDateEqualToInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool.DateTime->isDateBeforeInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool.DateTime->isDateBeforeOrEqualToInTimeZone(DateTime $dateTime, \DateTimeZone $timeZone): bool.Month->$monthOfYear to Month->$month.Date->$dayOfMonth to Date->$day.DateTime->isAtMidnight(): bool.DateTime->isNotAtMidnight(): bool.DateTime->isAtMidnightInTimeZone(\DateTimeZone $timeZone): bool.DateTime->isNotAtMidnightInTimeZone(\DateTimeZone $timeZone): bool.DateTime->setTimeInTimeZone(Time $time, \DateTimeZone $timeZone): self.DateTime->formatInTimeZone(string $format, \DateTimeZone $timeZone).Day.Days.$day value of Month to be a Day instead of an int.digital-craftsman/self-aware-normalizers.digital-craftsman/self-aware-normalizers to use the first stable version.isDate* methods from Moment.digital-craftsman/self-aware-normalizers.Clock implementation with SystemClock and FrozenClock.Moment, Date and Time like mustBeEqualTo with option to throw custom exception.Moment to include microseconds.is*InTimeZone(Time | Date | Month | Year $equalTo, \DateTimeZone $timeZone): bool methods to Moment.Time (like isNotAfter(self $time): bool).isDate*InTimeZone methods from Moment (will be removed in next minor version).How can I help you explore Laravel packages today?