Rename the filter Date to Datetime. Introduce Date
This commit is contained in:
parent
e1944d95f3
commit
e289fc6b8f
3 changed files with 13 additions and 6 deletions
|
|
@ -268,13 +268,20 @@ class Map(Filter):
|
|||
raise KeyError('Unable to handle %r' % txt)
|
||||
|
||||
|
||||
class Date(Filter):
|
||||
class DateTime(Filter):
|
||||
def filter(self, txt):
|
||||
if empty(txt):
|
||||
return txt
|
||||
return parse_date(txt)
|
||||
|
||||
|
||||
class Date(DateTime):
|
||||
def filter(self, txt):
|
||||
datetime = super(Date, self).filter(txt)
|
||||
if datetime is not None:
|
||||
return datetime.date
|
||||
|
||||
|
||||
class Time(Filter):
|
||||
klass = datetime.time
|
||||
regexp = re.compile(ur'(?P<hh>\d+):?(?P<mm>\d+)(:(?P<ss>\d+))?')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue