Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#742 closed defect (fixed)

history raises error in datetime while using non english language

Reported by: radek <translate@…> Owned by: adrian
Component: Core (Other) Version: 1.0
Severity: major Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I slightly polished, which was the reason of rasing error in Admin/history, when using different locale settings.


Index: C:/Python24/Lib/site-packages/django/utils/
--- C:/Python24/Lib/site-packages/django/utils/	(revision 1092)
+++ C:/Python24/Lib/site-packages/django/utils/	(working copy)
@@ -14,6 +14,7 @@
 from django.utils.dates import MONTHS, MONTHS_AP, WEEKDAYS
 from django.utils.tzinfo import LocalTimezone
 from calendar import isleap
+from calendar import monthrange
 import re, time
 re_formatchars = re.compile(r'(?<!\\)([aABdDfFgGhHiIjlLmMnNOPrsStTUwWyYzZ])')
@@ -124,10 +125,6 @@
     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(
             return '1'
@@ -185,7 +182,8 @@
     def t(self):
         "Number of days in the given month; i.e. '28' to '31'"
-        raise NotImplementedError
+        num = monthrange(,[1]
+        return '%02d' % num
     def T(self):
         "Time zone of this machine; e.g. 'EST' or 'MDT'" 

Change History (4)

comment:1 Changed 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [1116]) Fixed #742 -- Implemented 't' dateformat. Thanks, radek.

comment:2 Changed 9 years ago by ruben.perez@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hi, this issue is not working with languages like es, es-es, es-mx, etc... The output is something like this: "LunAMCESTE_171CEST03_CEST1AbrE_Abril1146273358FalseFalse" instead of "24 de Abril, 2006, 3:15 a.m.". I´ve checked my and it is the same like yours.

Thank You Very Much.

comment:3 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from reopened to closed

Closing this ticket. Please reopen with more information if it's still a problem.

comment:4 Changed 9 years ago by anonymous

  • milestone Version 1.0 deleted

Milestone Version 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top