Browse files

fix date formatting and string encoding

  • Loading branch information...
1 parent be8f87c commit 136c9752758241e1aa44aeb2cc33c2d343c60083 @razum2um committed Dec 3, 2011
Showing with 7 additions and 4 deletions.
  1. +7 −4 jira
View
11 jira
@@ -1088,16 +1088,19 @@ def encode(s):
'''Deal with unicode in text fields'''
if s == None:
return "None"
+ if not isinstance(s, basestring):
+ s = unicode(s)
if type(s) == unicode:
s = s.encode("utf-8")
- return str(s)
+ return s
def dateStr(i):
'''TODO Why are dates from JIRA at GMT-1?
TODO Convert to 12 hour too?'''
- if i == None or i == 'None':
- return str(i)
- return "%04d/%02d/%02d %02d:%02d:%02d GMT-1" % (i[0], i[1], i[2], i[3], i[4], i[5])
+ return str(i)
+ #if i == None or i == 'None':
+ # return str(i)
+ #return "%04d/%02d/%02d %02d:%02d:%02d GMT-1" % (i[0], i[1], i[2], i[3], i[4], i[5])
def getName(id, fields):
'''TODO cache this, and note getCustomFields() needs admin privilege'''

0 comments on commit 136c975

Please sign in to comment.