Skip to main content

Lektor plugin to help with dates and times

Project description


This is a plugin for Lektor which provides some helpers for dealing with dates and times.

Currently this provides a dateordatetime model field type which can contain either a date or a datetime.

Also the following jinja filters are provided:

Returns an iso formatted version the datetime, with timezone information. If dt is naive, it is localized to the site’s default timezone.
If dt is naive, it is localized to the site’s default timezone.


Release 0.2 (2017-08-04)

New features

Make lists of dateordatetime types sortable

The dateordatetime custom Lektor type now returns subclasses of or datetime.datetime which can be compared against one another. Normally, attempts to compare a date against a datetime results in a TypeError being raised. This made it difficult to sort on dateordatetime values.

Now dates sort before any datetimes with the same date. Naïve datetimes sort before timezone-aware datetimes with the same date.

Release 0.1 (2017-04-19)

Initial release.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for lektor-datetime-helpers, version 0.2
Filename, size File type Python version Upload date Hashes
Filename, size lektor_datetime_helpers-0.2-py2.py3-none-any.whl (4.9 kB) File type Wheel Python version 2.7 Upload date Hashes View hashes
Filename, size lektor-datetime-helpers-0.2.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page