Releases: hananils/kirby-date-methods
Releases · hananils/kirby-date-methods
Version 2.1.0: Locale relative dates
- Add missing locale setting to
dateRelative()
Version 2.0.1: Examples
- Added examples to the readme.
Version 2.0.0: Time Traveller
This update add more date methods and improves the overall documentation.
There are now the following methods available:
1. Converters
Converters read a date string and convert it to PHP date and time objects like DateTime
, DateTimeImmutable
or DateInterval
or arrays.
toDateTime()
ordatetime()
toDateTimeImmutable()
toDateInterval()
toDateDiff()
toDatePeriod()
toDates()
2. Formatters
Formatters read a date string and return a formatted and localized string, either absolute or relative.
toFormatted()
ordateFormatted()
toFormattedPattern()
toRelative()
ordateRelative()
toTime()
toAge()
toDateRange()
ordateRange()
3. Modifiers
Modifiers adjust dates to the current day, month or year which is helpful when you need to display the birthday of a person this year.
toDateRounded()
ordateRounded()
toCurrentYear()
toCurrentMonth()
toCurrentDay()
normalizeDate()
normalizeTime()
4. Validators
Version 1.0.0
Initial release.