Fix timezone bug for ATOM generation

This commit is contained in:
Rémy HUBSCHER 2011-08-16 15:11:49 +02:00
commit 32a6ecbcc5
4 changed files with 16 additions and 9 deletions

View file

@ -7,7 +7,7 @@ from functools import partial
import locale
from feedgenerator import Atom1Feed, Rss201rev2Feed
from pelican.utils import get_relative_path, local_to_utc
from pelican.utils import get_relative_path, set_date_tzinfo
from pelican.paginator import Paginator
from pelican.log import *
@ -37,7 +37,8 @@ class Writer(object):
description=item.content,
categories=item.tags if hasattr(item, 'tags') else None,
author_name=getattr(item, 'author', 'John Doe'),
pubdate=local_to_utc(item.date.timetuple()))
pubdate=set_date_tzinfo(item.date,
self.settings.get('TIMEZONE', None)))
def write_feed(self, elements, context, filename=None, feed_type='atom'):
"""Generate a feed with the list of articles provided