diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-11-06 23:53:13 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-11-06 23:53:13 +0000 |
| commit | 371f63c210ffd015cdaddba2dc5463f78051be4e (patch) | |
| tree | 3e2ae0152a35194d3fc22ff8528f31287739a3f5 /django/utils/dateformat.py | |
| parent | d4df074d418ce61b9fca3df7ce887e7a5f54b01f (diff) | |
Fixed #742 -- Implemented 't' dateformat. Thanks, radek.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1116 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/dateformat.py')
| -rw-r--r-- | django/utils/dateformat.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/django/utils/dateformat.py b/django/utils/dateformat.py index 9913c3f8c4..4e5f2bc8c0 100644 --- a/django/utils/dateformat.py +++ b/django/utils/dateformat.py @@ -13,7 +13,7 @@ Usage: from django.utils.dates import MONTHS, MONTHS_AP, WEEKDAYS from django.utils.tzinfo import LocalTimezone -from calendar import isleap +from calendar import isleap, monthrange import re, time re_formatchars = re.compile(r'(?<!\\)([aABdDfFgGhHiIjlLmMnNOPrsStTUwWyYzZ])') @@ -124,10 +124,6 @@ class DateFormat(TimeFormat): def I(self): "'1' if Daylight Savings Time, '0' otherwise." - raise NotImplementedError - - def I(self): - "'1' if Daylight Savings Time, '0' otherwise." if self.timezone.dst(self.data): return '1' else: @@ -185,7 +181,7 @@ class DateFormat(TimeFormat): def t(self): "Number of days in the given month; i.e. '28' to '31'" - raise NotImplementedError + return '%02d' % monthrange(self.data.year, self.data.month)[1] def T(self): "Time zone of this machine; e.g. 'EST' or 'MDT'" |
