Browse Source

fixes the problem of comparing dates offset-naive and offset-aware datetimes by removing the timezone before comparison

main
Henning@Mac 12 years ago
committed by Lakshmi Vyasarajan
parent
commit
11f4fdfd0c
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      hyde/ext/plugins/git.py

+ 2
- 0
hyde/ext/plugins/git.py View File

@@ -47,7 +47,9 @@ class GitDatesPlugin(Plugin):
continue continue
if created == "git": if created == "git":
created = parse(commits[-1].strip()) created = parse(commits[-1].strip())
created = created.replace(tzinfo=None)
resource.meta.created = created resource.meta.created = created
if modified == "git": if modified == "git":
modified = parse(commits[0].strip()) modified = parse(commits[0].strip())
modified = modified.replace(tzinfo=None)
resource.meta.modified = modified resource.meta.modified = modified

Loading…
Cancel
Save