Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed datestr error on windows. (closes #155)

`strftime("%B %e")` doesn't work on Windows. Falling back to "%B %d"
in case of failure.
  • Loading branch information...
commit 6e1e7d21347b13be4d35d741c09fc72118285a0d 1 parent 3f4a86c
@anandology anandology authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 web/utils.py
View
7 web/utils.py
@@ -911,7 +911,12 @@ def agohence(n, what, divisor=None):
if abs(deltadays) < 4:
return agohence(deltadays, 'day')
- out = then.strftime('%B %e') # e.g. 'June 13'
+ try:
+ out = then.strftime('%B %e') # e.g. 'June 3'
+ except ValueError:
+ # %e doesn't work on Windows.
+ out = then.strftime('%B %d') # e.g. 'June 03'
+
if then.year != now.year or deltadays < 0:
out += ', %s' % then.year
return out
Please sign in to comment.
Something went wrong with that request. Please try again.