diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-26 08:08:55 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-08-26 08:08:55 +0000 |
| commit | 3111d7f60b67d5aefa4d891d1d9a86ba56d7607c (patch) | |
| tree | 347fb6354a1108a9435d01a6740f756dc9f50a82 /docs | |
| parent | 61957df17f5555409f689c29b8d75bef9f998c21 (diff) | |
Fixed #7201 -- Fixed the timeuntil filter to work correctly with timezone-aware
times. Patch from Jeremy Carbaugh.
This is backwards incompatible in the sense that previously, if you tried to
compare timezone-aware and timezone-naive values, you got an incorrect result.
Now you get an empty string. So your previously incorrect code returns a
different incorrect result.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8579 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/builtins.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 20c5ee513e..6fc0d5cf1e 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -1332,6 +1332,8 @@ For example, if ``blog_date`` is a date instance representing midnight on 1 June 2006, and ``comment_date`` is a date instance for 08:00 on 1 June 2006, then ``{{ blog_date|timesince:comment_date }}`` would return "8 hours". +Comparing offset-naive and offset-aware datetimes will return an empty string. + Minutes is the smallest unit used, and "0 minutes" will be returned for any date that is in the future relative to the comparison point. @@ -1349,6 +1351,8 @@ Takes an optional argument that is a variable containing the date to use as the comparison point (instead of *now*). If ``from_date`` contains 22 June 2006, then ``{{ conference_date|timeuntil:from_date }}`` will return "1 week". +Comparing offset-naive and offset-aware datetimes will return an empty string. + Minutes is the smallest unit used, and "0 minutes" will be returned for any date that is in the past relative to the comparison point. |
