La date peut valoir None dans localized_datetime

This commit is contained in:
Pierre-Elliott Bécue 2015-09-26 21:21:56 +02:00
parent 8213b919ee
commit af251f267b

View file

@ -350,6 +350,7 @@ def localized_datetime(date=None, tz=None):
%Y%m%d%H%M%S, and a tz timezone looking like +0200""" %Y%m%d%H%M%S, and a tz timezone looking like +0200"""
if tz is None: if tz is None:
if date is not None:
if "+" in date or '-' in date or 'Z' in date: if "+" in date or '-' in date or 'Z' in date:
if date.endswith("Z"): if date.endswith("Z"):
date = date[:-1] + "+0000" date = date[:-1] + "+0000"