Search by

hananils / kirby-date-methods

hananils

Parsing and formatting dates can be difficult, especially if you deal with multilingual content. Date Methods aims to simplify date output by providing page and field methods to handle points in time as well as date ranges accurately in your snippets and templates.

Package info

github.com/hananils/kirby-date-methods

Homepage

Type:kirby-plugin

pkg:composer/hananils/kirby-date-methods

Statistics

Installs: 895

Dependents: 0

Suggesters: 0

Stars: 29

Open Issues: 0

3.2.0 2026-03-16 12:37 UTC

This package is auto-updated.

Last update: 2026-09-25 07:27:39 UTC


README

Date Methods for Kirby CMS

Parsing and formatting dates can be difficult, especially if you deal with multilingual content. Date Methods aims to simplify date output by providing page and field methods to handle points in time as well as date ranges accurately in your snippets and templates.

Features

Date Methods are available as page and field methods depending on their context. Where possible, helper functions are also provided.

Tip

Check out the reference and learn more about field, page and helper methods.

Parse dates

Parser methods read the field value and convert it to PHP date and time objects like DateTime, DateTimeImmutable or DateInterval.

Modify dates

Modifier methods allow to round times or adjust dates to the current day, month or year:

Additionally, Date Methods provides the following helpers to modify date and times:

Format dates

Formatter field and page methods take a field value and convert it to a formatted and localized string, either absolute or relative.

In addition to the field methods, the following helpers are available:

Validate dates

The plugin offers two methods to validate if a date is ealier or later than a reference date:

Both method accept an optional flag to check for equality as well.

Installation

By default, plugins in Kirby reside in a special folder located at /site/plugins. Each plugin is installed in its proprietary subfolder. This installation can be handled in four different ways: you can either install them manually or manage them using Kirby CLI, Git submodules or Composer. You can install Date Methods either way and should choose the method suiting your project best.

Please note that all examples given here assume you are using the default plugin root. If you changed your plugin root, e. g. with a custom folder setup, you’ll also have to adjust the paths given in this guide. For further information on how to manage plugins, please read the official Kirby plugin introduction.

Download

Download and copy this repository to /site/plugins/date-methods.

Kirby CLI

kirby plugin:install hananils/kirby-date-methods

Git submodule

git submodule add \
    https://github.com/hananils/kirby-date-methods.git \
    site/plugins/date-methods

Composer

composer require hananils/kirby-date-methods

Documentation

Find all documentation at kirby.hananils.de

Where possible, files contain inline annotations. For extended documentation, please visit our dedicated plugin site at kirby.hananils.de/​plugins/​date-methods.

Reference

License

This plugin is provided freely under the MIT license by hana+nils · Büro für Gestaltung. We create visual designs for digital and analog media.