diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-02-21 21:22:10 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2022-02-21 21:22:10 +0100 |
| commit | 0729fb76b52dcdaaf6d9b7f4dd60bc0099f067c3 (patch) | |
| tree | b9ca7b00301e3c4698302f67a94789fed78a6b85 /helpers.py | |
| parent | 5876793d01ab2e392e93eec9323dd6a7edb53170 (diff) | |
| download | quatuorbellefeuille.com-0729fb76b52dcdaaf6d9b7f4dd60bc0099f067c3.tar.xz | |
[wip] Add CDATA
Doesn't work yet, the tags get escaped. Maybe lxml has a simpler API?
Diffstat (limited to 'helpers.py')
| -rw-r--r-- | helpers.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -145,3 +145,15 @@ def touchup_plaintext(plaintext): for regexp, repl in _TOUCHUPS: text = regexp.sub(repl, text) return text + + +DATE_FORMATTERS = { + 'en': { + 'date': lambda d: d.strftime('%A %B %-d, %Y'), + 'time': lambda d: d.strftime('%I:%M %P'), + }, + 'fr': { + 'date': lambda d: d.strftime('%A %-d %B %Y').capitalize(), + 'time': lambda d: d.strftime('%Hh%M'), + }, +} |
