[Fix] : Fix the problem of formatLang for printing the date

bzr revid: sbh@tinyerp.com-20100805064423-4mej8zmyaohd7qqk
This commit is contained in:
sbh (Open ERP) 2010-08-05 12:14:23 +05:30
parent 4248468d92
commit 7b6b348700
1 changed files with 3 additions and 3 deletions

View File

@ -110,7 +110,7 @@ class _date_format(str, _format):
if self.val:
if getattr(self,'name', None):
date = datetime.strptime(self.name, DT_FORMAT)
return date.strftime(self.lang_obj.date_format)
return date.strftime(str(self.lang_obj.date_format))
return self.val
class _dttime_format(str, _format):
@ -121,8 +121,8 @@ class _dttime_format(str, _format):
def __str__(self):
if self.val and getattr(self,'name', None):
return datetime.strptime(self.name, DHM_FORMAT)\
.strftime("%s %s"%(self.lang_obj.date_format,
self.lang_obj.time_format))
.strftime("%s %s"%(str(self.lang_obj.date_format),
str(self.lang_obj.time_format)))
return self.val