Lektor plugin to help with dates and times
Project description
Introduction
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:
- isoformat(dt)
Returns an iso formatted version the datetime, with timezone information. If dt is naive, it is localized to the site’s default timezone.
- localize_datetime(dt)
If dt is naive, it is localized to the site’s default timezone.
Changelog
Release 0.3.3.post1 (2021-08-16)
Fix useless comparison in test.
Fix formatting in CHANGES.rst.
Release 0.3.3 (2021-08-15)
Bugs
Pin tzlocal<3. (Tzlocal >= 3 drops support for python 2.)
Release 0.3.2 (2020-11-19)
Bugs
Ensure that comparable_date and comparable_datetime objects are hashable. This fixes issues using these classes with pytz under py3k.
Testing
Test under py3.9
Release 0.3.1 (2020-05-21)
This release freshens the packaging. There are no substantive changes to the code in this release.
Packaging
Update packaging to PEP 517.
Update LICENSE to latest 3-clause BSD text.
Docstrings
Fix docstring syntax. No substantive changes.
Tests
Test under python 3.7 and 3.8.
Use twine check rather than setup.py check to test description syntax.
Release 0.3 (2018-01-18)
Fix things so that date and datetime types returned by the dateordatetime Lektor type are comparable against None. (None compares less than all other dates and datetimes.)
Release 0.2 (2017-08-04)
New features
Make lists of dateordatetime types sortable
The dateordatetime custom Lektor type now returns subclasses of datetime.date 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for lektor-datetime-helpers-0.3.3.post1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4664cd34e1159b52c13cca0fea77b417ebf43bd0d2c927fc7857e1bf51c6bf6f |
|
MD5 | cada0920417f9a1de35a34c401ce7537 |
|
BLAKE2b-256 | 8a039e2fcf06df06b0178992318f1e25478ba311c1f4a78a28b1b872016d84af |
Hashes for lektor_datetime_helpers-0.3.3.post1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f88153adfca9d3da7e3433e7e9bcbe2ceccfb06852c7a0e9a63a0627b04aac34 |
|
MD5 | 2a9471524b6b44e3a4c495aa1de1d7cf |
|
BLAKE2b-256 | bdf1721d1c31c9e5d7a7f9b883ffab1f30241f52eb3338878e7c86cf07913cc5 |