Skip to content

Commit

Permalink
Restored strftimeFormatter as a class.
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed May 8, 2011
1 parent b24db9c commit 3ec9588
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changelog
3.0 (unreleased)
----------------

- Restored `strftimeFormatter` as a class.

- Added tests for read-only class attributes and interface.

3.0a2 (2011-05-07)
Expand Down
10 changes: 8 additions & 2 deletions src/DateTime/DateTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,14 @@ def Timezones():
return sorted(list(PytzCache._zmap.values()))


def strftimeFormatter(dt, format):
return dt.strftime(format)
class strftimeFormatter(object):

def __init__(self, dt, format):
self.dt = dt
self.format = format

def __call__(self):
return self.dt.strftime(self.format)


class DateTime(object):
Expand Down

0 comments on commit 3ec9588

Please sign in to comment.